/* CRITICAL: prevents Leaflet from collapsing */
#tcf-map {
    width: 100%;
    height: 500px !important;
    min-height: 500px;
    display: block;
}

.tcf-right {
    overflow: hidden;
    position: relative;
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
}


/* Mobile stacking */
@media (max-width: 768px) {
    .tcf-layout {
        flex-direction: column;
    }

    #tcf-map {
        height: 350px !important;
    }
}


.tcf-form-wrapper {
    flex-direction: column;
    gap: 20px;
}

.tcf-form {
    max-width: 100%;
    width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

/* LEFT: FORM */
.tcf-left {
    display: block !important;
    flex: 1;
    min-width: 320px;
}

/* RIGHT: MAP */
.tcf-right {
    flex: 1;
    min-width: 320px;
    display: block;
    position: relative;
}

/* Responsive container widths */
@media (min-width: 576px) {
    .tcf-form {
        max-width: 540px;
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .tcf-form {
        max-width: 720px;
        padding: 25px;
    }
}

@media (min-width: 992px) {
    .tcf-form {
        max-width: 600px;
    }
}

.tcf-form .tcf-input {
    display: flex;
    flex-direction: column;
}

.tcf-form .tcf-input input[type="text"],
.tcf-form .tcf-input input[type="email"],
.tcf-form .tcf-input input[type="tel"],
.tcf-form .tcf-input input[type="datetime-local"],
.tcf-form .tcf-input select {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
}

/* Custom select arrow */
.tcf-form .tcf-input select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M6 8L0 0h12z" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

/* Prevent zoom on iOS */
@media (max-width: 767px) {
    .tcf-form .tcf-input input[type="text"],
    .tcf-form .tcf-input input[type="email"],
    .tcf-form .tcf-input input[type="tel"],
    .tcf-form .tcf-input select {
        font-size: 16px;
        padding: 14px 15px;
    }

    .tcf-form .tcf-input select {
        padding-right: 45px;
    }
}

.tcf-form .tcf-input input[type="text"]:focus,
.tcf-form .tcf-input input[type="email"]:focus,
.tcf-form .tcf-input input[type="tel"]:focus,
.tcf-form .tcf-input select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.tcf-form .tcf-input label {
    display: block;
    margin-bottom: 5px;
    margin-top: 15px;
    font-weight: 600;
    color: #333;
}

.tcf-form .tcf-input label:first-of-type {
    margin-top: 0;
}

.tcf-form button {
    background-color: #0073aa;
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 20px 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 767px) {
    .tcf-form button {
        padding: 16px 24px;
        font-size: 17px;
        margin: 25px 0 20px 0;
    }
}

.tcf-form button:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.tcf-form button:active:not(:disabled) {
    transform: translateY(0);
}

.tcf-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dpc-output {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    display: none;
    line-height: 1.6;
    word-wrap: break-word;
}

@media (max-width: 767px) {
    .dpc-output {
        padding: 18px;
        font-size: 15px;
    }
}

.dpc-output.show {
    display: block;
}

.dpc-output.success {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.dpc-output.error {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.dpc-output.loading {
    background-color: #d1ecf1;
    border: 2px solid #bee5eb;
    color: #0c5460;
}

/* Responsive text sizing */
@media (max-width: 767px) {
    .tcf-form {
        font-size: 15px;
    }
    
    .tcf-form strong {
        font-size: 16px;
    }
}

.dpc-price-breakdown {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    font-size: 14px;
}

.dpc-price-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    padding: 2px 0;
}

.dpc-price-total {
    border-top: 2px solid #0073aa;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
    font-size: 16px;
    color: #0073aa;
}

/* Improve touch targets */
@media (hover: none) and (pointer: coarse) {
    .tcf-form button {
        min-height: 48px;
    }
    
    .tcf-form .tcf-input input[type="text"],
    .tcf-form .tcf-input input[type="email"],
    .tcf-form .tcf-input input[type="tel"],
    .tcf-form .tcf-input select {
        min-height: 48px;
    }
}

/* Form Layout Styles */
.dpc-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.dpc-form-row .dpc-form-col {
    flex: 1;
}

@media (max-width: 767px) {
    .dpc-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Date/Time Picker Styles */
.tcf-datetime-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tcf-datetime-container input[type="date"],
.tcf-datetime-container input[type="time"] {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.tcf-datetime-container input[type="date"] {
    flex: 2;
}

.tcf-datetime-container input[type="time"] {
    flex: 1;
}

@media (max-width: 767px) {
    .tcf-datetime-container {
        flex-direction: column;
        gap: 8px;
    }

    .tcf-datetime-container input[type="date"],
    .tcf-datetime-container input[type="time"] {
        width: 100%;
        padding: 14px 15px;
    }
}

/* Toggle Switch Styles */
.dpc-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.dpc-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.dpc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dpc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.dpc-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.dpc-toggle input:checked + .dpc-toggle-slider {
    background-color: #0073aa;
}

.dpc-toggle input:checked + .dpc-toggle-slider:before {
    transform: translateX(26px);
}

/* Textarea Styles */
.tcf-form .tcf-input textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.tcf-form .tcf-input textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

@media (max-width: 767px) {
    .tcf-form .tcf-input textarea {
        font-size: 16px;
        padding: 14px 15px;
        min-height: 100px;
    }
}


