/**
 * Contact Sales Popup Modal Styles
 * 
 * Matches Figma design: Node 950:9169
 * Background: #f0eeea
 * Input background: #f6f5f1
 * Primary text: #0c0c0c
 * Secondary text: #5a5a5a
 * Placeholder: rgba(0,0,0,0.5)
 * Border radius: 24px (modal), 12px (inputs/button)
 */

/* ================================
   Modal Container & Backdrop
   ================================ */
.wtd-contact-sales-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wtd-contact-sales-modal.active {
    opacity: 1;
    visibility: visible;
}

.wtd-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 12, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ================================
   Modal Content Box
   ================================ */
.wtd-modal-content {
    position: relative;
    background: #f0eeea;
    border: 1px solid #f9f9f9;
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 64px;
    box-sizing: border-box;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wtd-contact-sales-modal.active .wtd-modal-content {
    transform: translateY(0) scale(1);
}

/* Close button */
.wtd-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.wtd-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wtd-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #0c0c0c;
    stroke-width: 2;
}

/* ================================
   Modal Title
   ================================ */
.wtd-modal-title {
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    color: #0c0c0c;
    margin: 0 0 32px;
}

/* ================================
   Form Styles
   ================================ */
.wtd-contact-sales-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wtd-form-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wtd-form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.wtd-form-label {
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 350;
    text-transform: uppercase;
    color: #5a5a5a;
    letter-spacing: 0.02em;
}

.wtd-form-label .wtd-optional {
    text-transform: none;
    font-size: 12px;
    color: #888;
    font-weight: 300;
}

.wtd-form-input {
    background: #f6f5f1;
    border: 1px solid #d4d3cf;
    border-radius: 12px;
    height: 56px;
    padding: 12px 16px;
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 350;
    color: #0c0c0c;
    width: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    outline: none;
}

.wtd-form-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.wtd-form-input:focus {
    background: #f2f1ed;
    border-color: #bababa;
    box-shadow: 0 0 0 2px rgba(12, 12, 12, 0.1);
}

/* Phone input with country code dropdown */
.wtd-phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f6f5f1;
    border: 1px solid #d4d3cf;
    border-radius: 12px;
    height: 56px;
    transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.wtd-phone-input-wrapper:focus-within {
    background: #f2f1ed;
    border-color: #bababa;
    box-shadow: 0 0 0 2px rgba(12, 12, 12, 0.1);
}

/* Country code dropdown */
.wtd-country-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 0 8px 0 16px;
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 350;
    color: #0c0c0c;
    cursor: pointer;
    height: 100%;
    min-width: 85px;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 20px;
}

.wtd-country-select:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.wtd-country-select option {
    font-size: 14px;
    padding: 8px;
}

/* Divider between country code and phone input */
.wtd-phone-input-wrapper::after {
    content: '';
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.wtd-phone-input-wrapper .wtd-form-input {
    background: transparent;
    height: 100%;
    padding-left: 12px;
    flex: 1;
    border: none !important;
    box-shadow: none !important;
}

.wtd-phone-input-wrapper .wtd-form-input:focus {
    background: transparent;
    box-shadow: none;
    border: none;
    outline: none;
}

/* Field error states - red border only, no text */
.wtd-form-field.has-error .wtd-form-input {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.5);
}

.wtd-form-field.has-error .wtd-phone-input-wrapper {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.5);
}

/* Hide error text messages */
.wtd-field-error {
    display: none;
}

/* ================================
   Form Error Message (Top of form)
   ================================ */
.wtd-form-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 8px;
    display: none;
}

/* ================================
   Submit Button
   ================================ */
.wtd-form-actions {
    margin-top: 16px;
}

.wtd-btn-submit {
    width: 100%;
    height: 56px;
    background: #0c0c0c;
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wtd-btn-submit:hover {
    background: #2a2a2a;
}

.wtd-btn-submit:active {
    transform: scale(0.98);
}

.wtd-btn-submit:disabled {
    background: #666;
    cursor: not-allowed;
}

.wtd-btn-loading {
    position: relative;
}

.wtd-btn-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================
   Success State
   ================================ */
.wtd-contact-sales-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
    min-height: 320px;
}

.wtd-success-icon {
    width: 80px;
    height: 80px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.wtd-success-icon svg {
    width: 40px;
    height: 40px;
    stroke: #28a745;
    stroke-width: 3;
}

.wtd-success-title {
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 24px;
    font-weight: 400;
    color: #0c0c0c;
    margin: 0 0 12px;
}

.wtd-success-message {
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 350;
    color: #5a5a5a;
    line-height: 1.5;
    margin: 0 0 32px;
    max-width: 320px;
}

.wtd-btn-close-success {
    background: #f6f5f1;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-family: 'ABC Favorit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #0c0c0c;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wtd-btn-close-success:hover {
    background: #ebe9e5;
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 640px) {
    .wtd-modal-content {
        padding: 40px 24px;
        max-width: 100%;
        border-radius: 20px;
        margin: 0;
    }
    
    .wtd-modal-title {
        font-size: 26px;
        margin-bottom: 24px;
    }
    
    .wtd-contact-sales-form {
        gap: 20px;
    }
    
    .wtd-form-fields {
        gap: 20px;
    }
    
    .wtd-form-input,
    .wtd-phone-input-wrapper,
    .wtd-btn-submit {
        height: 52px;
    }
    
    .wtd-modal-close {
        top: 16px;
        right: 16px;
    }
}

/* ================================
   Accessibility
   ================================ */
@media (prefers-reduced-motion: reduce) {
    .wtd-contact-sales-modal,
    .wtd-modal-content,
    .wtd-form-input,
    .wtd-btn-submit,
    .wtd-success-icon {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wtd-form-input,
    .wtd-phone-input-wrapper {
        border: 2px solid #0c0c0c;
    }
    
    .wtd-btn-submit {
        border: 2px solid #ffffff;
    }
}

