/**
 * Turbo - Checkout Verifications Styles
 * Optimized for Divi Theme + WooCommerce
 */

/* ============================================
   ADDRESS VERIFICATION STYLES
   ============================================ */

/* Error state when address not selected from autocomplete */
.tcv-address-invalid,
input.tcv-address-invalid {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.tcv-address-invalid:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.tcv-address-row-invalid {
    position: relative;
}

.tcv-address-error {
    display: block !important;
    color: #dc2626 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 6px !important;
    padding-left: 2px !important;
}

.tcv-address-error::before {
    content: '⚠ ';
}

/* Verified state when address selected from autocomplete */
.tcv-address-verified,
input.tcv-address-verified {
    border-color: #10b981 !important;
}

.tcv-address-row-verified .tcv-address-wrapper::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
}

.tcv-address-wrapper {
    position: relative !important;
}

/* ============================================
   EMAIL VALIDATION STYLES
   ============================================ */

.tcv-email-error,
.tcv-email-match-error {
    display: block !important;
    color: #dc2626 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 6px !important;
    padding-left: 2px !important;
}

.tcv-email-error::before,
.tcv-email-match-error::before {
    content: '⚠ ';
}

.tcv-field-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.tcv-field-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* WooCommerce validation styling override */
.woocommerce-checkout .form-row.woocommerce-invalid-email input,
.woocommerce-checkout .form-row.woocommerce-invalid-email-match input {
    border-color: #dc2626 !important;
}

.woocommerce-checkout .form-row.woocommerce-validated input {
    border-color: #10b981 !important;
}

/* Confirm email field styling */
.tcv-confirm-email-row,
#billing_email_confirm_field,
p#billing_email_confirm_field {
    margin-top: 15px !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 4 !important;
    -webkit-order: 4 !important;
}

.tcv-confirm-email-row label,
#billing_email_confirm_field label {
    display: block !important;
    margin-bottom: 8px !important;
}

.tcv-confirm-email-row input,
#billing_email_confirm_field input {
    width: 100% !important;
}

/* Disable paste visual indicator */
#billing_email_confirm {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* ============================================
   PHONE FIELD HIDING
   ============================================ */
.tcv-phone-field-hidden {
    display: none !important;
}

/* ============================================
   VERIFICATION SECTION - PROFESSIONAL DESIGN
   ============================================ */

/* Wrapper - Completely isolated from Divi's flex layout */
#tcv-verification-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 30px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex: none !important;
    float: none !important;
    clear: both !important;
    position: relative !important;
}

/* Inner styled container */
.tcv-verification-section {
    background: linear-gradient(145deg, #ffffff 0%, #f8fffe 100%);
    border: 2px solid #03A0A8;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 
        0 4px 6px -1px rgba(3, 160, 168, 0.1),
        0 10px 20px -5px rgba(3, 160, 168, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* Decorative accent line at top */
.tcv-verification-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #03A0A8 0%, #06c9d3 50%, #03A0A8 100%);
}

/* Header area with icon and title */
.tcv-verification-section h3 {
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a2b3c !important;
    font-family: 'Exo 2', Helvetica, Arial, sans-serif !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    letter-spacing: -0.3px !important;
}

.tcv-verification-section h3::before {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center center,
        linear-gradient(135deg, #03A0A8 0%, #028a91 100%);
    background-size: 22px, 100%;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(3, 160, 168, 0.3);
    flex-shrink: 0;
}

.tcv-verification-section h3 .required {
    color: #dc3545 !important;
    font-weight: 700 !important;
    font-size: 20px !important;
}

/* Description text */
.tcv-description {
    color: #5a6b7c !important;
    font-size: 15px !important;
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
    padding-left: 54px !important;
    line-height: 1.5 !important;
}

/* Phone input row */
.tcv-phone-row {
    display: flex !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

/* Phone input group (dropdown + input) */
.tcv-phone-input-group,
.tcv-verification-section .tcv-phone-input-group,
.tcv-phone-row .tcv-phone-input-group {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 auto !important;
    min-width: 250px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #f8fafc !important;
    transition: all 0.25s ease !important;
    align-items: stretch !important;
}

.tcv-phone-input-group:hover {
    border-color: #03A0A8 !important;
    background: #fff !important;
}

.tcv-phone-input-group:focus-within {
    border-color: #03A0A8 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(3, 160, 168, 0.12) !important;
}

/* Country code dropdown */
.tcv-country-select,
.tcv-verification-section .tcv-country-select,
.tcv-verification-section select.tcv-country-select,
select#tcv_country_code.tcv-country-select {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    flex: 0 0 95px !important;
    padding: 16px 8px !important;
    border: none !important;
    border-right: 2px solid #e1e8ed !important;
    background-color: #f0f4f8 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a2b3c !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    padding-right: 22px !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
}

.tcv-country-select:hover {
    background-color: #e8ecf0 !important;
}

.tcv-country-select:focus {
    outline: none !important;
    background-color: #e8ecf0 !important;
}

.tcv-country-select:disabled {
    background-color: #e8f5e9 !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
}

/* Phone number input (inside group) */
.tcv-phone-input,
.tcv-verification-section .tcv-phone-input,
.tcv-verification-section input.tcv-phone-input,
input#tcv_phone.tcv-phone-input {
    flex: 1 1 auto !important;
    min-width: 150px !important;
    width: auto !important;
    padding: 16px 20px !important;
    border: none !important;
    background: transparent !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #1a2b3c !important;
    letter-spacing: 1px !important;
    outline: none !important;
    box-shadow: none !important;
}

.tcv-phone-input:focus {
    outline: none !important;
}

.tcv-phone-input::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
}

.tcv-phone-input:read-only {
    background: #e8f5e9 !important;
}

/* Send Code button */
#tcv_send_code {
    padding: 16px 32px !important;
    background: linear-gradient(135deg, #03A0A8 0%, #028a91 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    font-family: 'Exo 2', Helvetica, Arial, sans-serif !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 14px rgba(3, 160, 168, 0.35) !important;
    position: relative !important;
    overflow: hidden !important;
}

#tcv_send_code::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#tcv_send_code:hover:not(:disabled)::before {
    left: 100%;
}

#tcv_send_code:hover:not(:disabled) {
    background: linear-gradient(135deg, #028a91 0%, #017a80 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(3, 160, 168, 0.45) !important;
}

#tcv_send_code:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(3, 160, 168, 0.3) !important;
}

#tcv_send_code:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Code verification row */
.tcv-code-row {
    display: flex !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

.tcv-code-row input[type="text"] {
    width: 180px !important;
    padding: 16px 20px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 12px !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: 12px !important;
    text-align: center !important;
    color: #1a2b3c !important;
    background: #f8fafc !important;
    transition: all 0.25s ease !important;
    font-family: 'Courier New', monospace !important;
}

.tcv-code-row input[type="text"]:hover {
    border-color: #10b981 !important;
    background: #fff !important;
}

.tcv-code-row input[type="text"]:focus {
    outline: none !important;
    border-color: #10b981 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}

.tcv-code-row input[type="text"]::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
    letter-spacing: 2px !important;
    font-size: 14px !important;
}

/* Verify button */
#tcv_verify_code {
    padding: 16px 32px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    font-family: 'Exo 2', Helvetica, Arial, sans-serif !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
    position: relative !important;
    overflow: hidden !important;
}

#tcv_verify_code::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#tcv_verify_code:hover::before {
    left: 100%;
}

#tcv_verify_code:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
}

#tcv_verify_code:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

#tcv_verify_code::after {
    content: '✓';
    font-size: 18px;
    font-weight: 700;
}

/* Messages */
#tcv_message {
    min-height: 28px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#tcv_message.tcv-success {
    color: #059669 !important;
}

#tcv_message.tcv-success::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #d1fae5;
    border-radius: 50%;
    font-size: 14px;
}

#tcv_message.tcv-error {
    color: #dc2626 !important;
}

#tcv_message.tcv-error::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fee2e2;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

/* Verified state */
.tcv-verification-section.tcv-verified {
    border-color: #10b981 !important;
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.tcv-verification-section.tcv-verified::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #10b981 100%) !important;
}

.tcv-verification-section.tcv-verified h3::before {
    background: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center center,
        linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-size: 22px, 100%;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.tcv-verification-section.tcv-verified #tcv_send_code {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

/* Countdown timer */
.tcv-countdown {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-radius: 24px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #92400e !important;
    margin-left: 14px !important;
    box-shadow: 0 2px 4px rgba(146, 64, 14, 0.1) !important;
}

.tcv-countdown::before {
    content: '⏱';
    font-size: 16px;
}

/* ============================================
   GOOGLE PLACES AUTOCOMPLETE DROPDOWN
   ============================================ */

.tcv-address-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.tcv-places-dropdown {
    display: none;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    z-index: 999999 !important;
    background: #fff !important;
    border: 2px solid #03A0A8 !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

.tcv-places-item {
    padding: 14px 18px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: all 0.2s ease !important;
}

.tcv-places-item:last-child {
    border-bottom: none !important;
    border-radius: 0 0 10px 10px !important;
}

.tcv-places-item:hover,
.tcv-places-item:active,
.tcv-places-item.tcv-places-active {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%) !important;
}

.tcv-places-main {
    display: block !important;
    font-weight: 600 !important;
    color: #1a2b3c !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
}

.tcv-places-secondary {
    display: block !important;
    color: #64748b !important;
    font-size: 13px !important;
    margin-top: 4px !important;
    line-height: 1.3 !important;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .tcv-verification-section {
        padding: 20px !important;
        border-radius: 12px !important;
    }
    
    .tcv-verification-section h3 {
        font-size: 18px !important;
    }
    
    .tcv-verification-section h3::before {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background-size: 18px;
    }
    
    .tcv-description {
        padding-left: 48px !important;
        font-size: 14px !important;
    }
    
    .tcv-phone-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .tcv-phone-input-group {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .tcv-country-select,
    select#tcv_country_code.tcv-country-select {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        flex: 0 0 90px !important;
        padding: 14px 8px !important;
        font-size: 14px !important;
    }
    
    .tcv-phone-input {
        font-size: 16px !important;
        padding: 14px 16px !important;
    }
    
    #tcv_send_code {
        width: 100% !important;
        padding: 16px 24px !important;
    }
    
    .tcv-code-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .tcv-code-row input[type="text"] {
        width: 100% !important;
        font-size: 20px !important;
    }
    
    #tcv_verify_code {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .tcv-places-dropdown {
        max-height: 250px !important;
    }
    
    .tcv-countdown {
        margin-left: 0 !important;
        margin-top: 10px !important;
        display: flex !important;
    }
}
