/* Callback Inquiry Form Styles */

/* Container */
.callback-form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

.callback-form-container * {
    box-sizing: border-box;
}

/* Title */
.callback-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: #1a1a1a;
    text-align: center;
}

/* Form */
.callback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Fields */
.callback-field {
    display: flex;
    flex-direction: column;
}

.callback-field label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: #374151;
}

.callback-field input,
.callback-field textarea,
.callback-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #1f2937;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.callback-field input::placeholder,
.callback-field textarea::placeholder {
    color: #9ca3af;
}

.callback-field input:focus,
.callback-field textarea:focus,
.callback-field select:focus {
    outline: none;
    border-color: var(--callback-primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.callback-field textarea {
    resize: vertical;
    min-height: 80px;
}

.callback-field select {
    cursor: pointer;
    appearance: none;
    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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Phone input group */
.callback-field-phone .phone-input-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    width: 100%;
}

.callback-field-phone .phone-input-group .country-code-select {
    width: auto !important;
    min-width: 120px !important;
    max-width: 150px !important;
    flex: 0 0 auto !important;
    padding: 12px 10px !important;
    padding-right: 28px !important;
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    border-right: none !important;
    border-radius: 8px 0 0 8px !important;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M5 7L1 3h8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
}

.callback-field-phone .phone-input-group .country-code-select:focus {
    outline: none;
    border-color: var(--callback-primary-color, #3b82f6) !important;
    background-color: #fff !important;
}

.callback-field-phone .phone-input-group input[type="tel"] {
    flex: 1 1 auto !important;
    min-width: 100px !important;
    width: auto !important;
    border-radius: 0 8px 8px 0 !important;
    border-left: none !important;
    padding: 12px 14px;
}

.callback-field-phone .phone-input-group input[type="tel"]:focus {
    border-left: 1px solid var(--callback-primary-color, #3b82f6) !important;
}

/* Submit button */
.callback-submit-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    background-color: var(--callback-btn-color, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.callback-submit-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.callback-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.callback-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.callback-submit-btn .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.callback-submit-btn .btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: callback-spin 0.8s linear infinite;
}

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

/* Messages */
.callback-message {
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.callback-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.callback-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Field errors */
.callback-field.has-error input,
.callback-field.has-error textarea,
.callback-field.has-error select {
    border-color: #ef4444;
}

.callback-field.has-error input:focus,
.callback-field.has-error textarea:focus,
.callback-field.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.callback-field .field-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}

/* Date input styling */
.callback-field input[type="date"] {
    cursor: pointer;
}

.callback-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.callback-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .callback-form-container {
        padding: 16px;
    }

    .callback-form-title {
        font-size: 1.25rem;
    }

    .callback-field input,
    .callback-field textarea,
    .callback-field select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .callback-submit-btn {
        padding: 12px 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .callback-form-container {
        color: #e5e7eb;
    }

    .callback-form-title {
        color: #f3f4f6;
    }

    .callback-field label {
        color: #d1d5db;
    }

    .callback-field input,
    .callback-field textarea,
    .callback-field select {
        background-color: #1f2937;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .callback-field input::placeholder,
    .callback-field textarea::placeholder {
        color: #6b7280;
    }

    .callback-field input:focus,
    .callback-field textarea:focus,
    .callback-field select:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    }

    .callback-field-phone .phone-input-group .country-code-select {
        background-color: #374151 !important;
        border-color: #4b5563 !important;
        color: #d1d5db;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%239ca3af' d='M5 7L1 3h8z'/%3E%3C/svg%3E") !important;
    }

    .callback-field-phone .phone-input-group .country-code-select:focus {
        background-color: #1f2937 !important;
    }

    .callback-field-phone .phone-input-group input[type="tel"] {
        background-color: #1f2937;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .callback-success {
        background-color: #064e3b;
        color: #a7f3d0;
        border-color: #065f46;
    }

    .callback-error {
        background-color: #7f1d1d;
        color: #fecaca;
        border-color: #991b1b;
    }
}

/* Animation for form appearance */
.callback-form-container {
    animation: callback-fadeIn 0.3s ease;
}

@keyframes callback-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden state for form after success */
.callback-form.is-hidden {
    display: none;
}

/* reCAPTCHA styling */
.callback-field-recaptcha {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.callback-field-recaptcha .g-recaptcha {
    transform-origin: center;
}

@media (max-width: 340px) {
    .callback-field-recaptcha .g-recaptcha {
        transform: scale(0.9);
    }
}
