/**
 * Frontend Form Styles
 * Optimized for consultation booking form with black and gold theme
 */

:root {
    --primary-black: #000000;
    --primary-gold: #C79735;
    --gold-light: #D4A85F;
    --gold-dark: #A67C28;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --medium-gray: #E0E0E0;
    --text-gray: #333333;
    --text-light: #666666;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

.acfb-form-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.acfb-form {
    background: #FFFFFF !important;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
}

.acfb-form-fields {
    margin-bottom: 30px;
}

.acfb-field-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.acfb-form-group {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* Label Positioning */
.acfb-label-top .acfb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-gray);
    font-size: 14px;
}

.acfb-label-left .acfb-form-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.acfb-label-left .acfb-form-group label {
    flex: 0 0 200px;
    font-weight: 600;
    color: var(--text-gray);
    margin: 0;
}

.acfb-label-left .acfb-form-group input,
.acfb-label-left .acfb-form-group select,
.acfb-label-left .acfb-form-group textarea {
    flex: 1;
}

/* Form Fields */
.acfb-form input[type="text"],
.acfb-form input[type="email"],
.acfb-form input[type="tel"],
.acfb-form input[type="date"],
.acfb-form input[type="time"],
.acfb-form select,
.acfb-form textarea {
    width: 100%;
    padding: 1px 18px;
    border: 2px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
    background: var(--white);
    color: var(--text-gray);
}

.acfb-form input:focus,
.acfb-form select:focus,
.acfb-form textarea:focus {
    border-color: var(--primary-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(199, 151, 53, 0.1);
}

.acfb-form textarea {
    resize: vertical;
    min-height: 120px;
}

.acfb-form 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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.acfb-required {
    color: var(--primary-gold);
    margin-left: 3px;
    font-size: 16px;
}

/* Placeholder styling */
.acfb-form input::placeholder,
.acfb-form textarea::placeholder,
.acfb-form select::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Checkbox and Radio */
.acfb-checkbox-label,
.acfb-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-gray);
}

.acfb-checkbox-label input[type="checkbox"],
.acfb-radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-gold);
}

.acfb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* File Upload */
.acfb-file-upload {
    width: 100%;
}

.acfb-file-drop-zone {
    position: relative;
    border: 2px dashed var(--medium-gray);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--light-gray);
}

.acfb-file-drop-zone:hover {
    border-color: var(--primary-gold);
    background: rgba(199, 151, 53, 0.05);
}

.acfb-file-drop-zone.dragover {
    border-color: var(--gold-dark);
    background: rgba(199, 151, 53, 0.1);
    transform: scale(1.01);
}

.acfb-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.acfb-file-drop-message svg {
    color: var(--primary-gold);
    margin-bottom: 15px;
}

.acfb-file-drop-message p {
    margin: 8px 0;
    color: var(--text-light);
    font-size: 14px;
}

.acfb-file-drop-message strong {
    color: var(--primary-gold);
    font-weight: 600;
}

.acfb-file-limits {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

.acfb-file-list {
    margin-top: 15px;
}

.acfb-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.acfb-file-item:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 2px 8px var(--shadow);
}

.acfb-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.acfb-file-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(199, 151, 53, 0.3);
}

.acfb-file-details {
    flex: 1;
}

.acfb-file-name {
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 4px;
    word-break: break-all;
    font-size: 14px;
}

.acfb-file-size {
    font-size: 12px;
    color: var(--text-light);
}

.acfb-file-remove {
    background: var(--primary-black);
    color: var(--white);
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.acfb-file-remove:hover {
    background: #333333;
    transform: translateY(-1px);
}

/* Submit Button */
.acfb-form-submit {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.acfb-submit-button {
    padding: 16px 48px;
    background: #a8cf45;
    color: #000000;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(199, 151, 53, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acfb-submit-button:hover {
    background:  #a8cf45;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(199, 151, 53, 0.4);
}

.acfb-submit-button:active {
    transform: translateY(0);
}

.acfb-submit-button:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner */
.acfb-loading {
    display: none;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.acfb-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    animation: acfb-spin 1s linear infinite;
}

@keyframes acfb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Messages */
.acfb-form-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}

.acfb-form-message.success {
    background: rgba(199, 151, 53, 0.1);
    color: var(--gold-dark);
    border: 2px solid var(--primary-gold);
}

.acfb-form-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
    border: 2px solid #dc3545;
}

/* Validation States */
.acfb-form input.error,
.acfb-form select.error,
.acfb-form textarea.error {
    border-color: #dc3545;
}

.acfb-form .field-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

/* Input Icons (optional enhancement) */
.acfb-form-group.has-icon {
    position: relative;
}

.acfb-form-group.has-icon input {
    padding-left: 45px;
}

.acfb-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Date and Time inputs styling */
.acfb-form input[type="date"],
.acfb-form input[type="time"] {
    cursor: pointer;
}

.acfb-form input[type="date"]::-webkit-calendar-picker-indicator,
.acfb-form input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(50%);
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .acfb-form {
        background: #FFFFFF !important;
        padding: 35px 25px;
    }
    
    /* Force white backgrounds on tablet */
    .acfb-form input[type="text"],
    .acfb-form input[type="email"],
    .acfb-form input[type="tel"],
    .acfb-form input[type="date"],
    .acfb-form input[type="time"],
    .acfb-form select,
    .acfb-form textarea {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: var(--text-gray) !important;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .acfb-form {
        background: #FFFFFF !important;
        padding: 30px 20px;
    }
    
    .acfb-field-row {
        flex-direction: column;
        gap: 0;
    }
    
    .acfb-form-group {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .acfb-label-left .acfb-form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .acfb-label-left .acfb-form-group label {
        flex: 1;
        width: 100%;
    }
    
    .acfb-submit-button {
        width: 100%;
        padding: 14px 24px;
        border-radius: 5px;
    }

    .acfb-file-drop-zone {
        padding: 30px 15px;
    }
    
    /* CRITICAL FIX: Force white background on all form inputs for mobile devices */
    .acfb-form input[type="text"],
    .acfb-form input[type="email"],
    .acfb-form input[type="tel"],
    .acfb-form input[type="date"],
    .acfb-form input[type="time"],
    .acfb-form select,
    .acfb-form textarea {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #333333 !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* Override select arrow for mobile */
    .acfb-form select {
        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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 15px center !important;
    }
    
    /* Ensure placeholder text is visible on white background */
    .acfb-form input::placeholder,
    .acfb-form textarea::placeholder,
    .acfb-form select::placeholder {
        color: #666666 !important;
        opacity: 0.7 !important;
    }
}

@media (max-width: 480px) {
    .acfb-form {
        background: #FFFFFF !important;
        padding: 20px 15px;
    }
    
    .acfb-form input[type="text"],
    .acfb-form input[type="email"],
    .acfb-form input[type="tel"],
    .acfb-form input[type="date"],
    .acfb-form input[type="time"],
    .acfb-form select,
    .acfb-form textarea {
        padding: 1px 15px;
        font-size: 14px;
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #333333 !important;
    }

    .acfb-file-item {
        padding: 12px;
        background: #FFFFFF !important;
    }

    .acfb-file-icon {
        width: 38px;
        height: 38px;
        font-size: 10px;
    }
}

/* Override dark mode completely - Force white background on all devices and color schemes */
@media (prefers-color-scheme: dark) {
    .acfb-form {
        background: #FFFFFF !important;
    }
    
    .acfb-form input[type="text"],
    .acfb-form input[type="email"],
    .acfb-form input[type="tel"],
    .acfb-form input[type="date"],
    .acfb-form input[type="time"],
    .acfb-form select,
    .acfb-form textarea {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #333333 !important;
        border-color: var(--medium-gray) !important;
        -webkit-text-fill-color: #333333 !important;
    }
    
    .acfb-form-group label {
        color: var(--text-gray) !important;
    }
    
    .acfb-file-item {
        background: #FFFFFF !important;
    }
    
    .acfb-file-drop-zone {
        background: var(--light-gray) !important;
    }
}

/* Additional mobile dark mode override - Extra specific for stubborn browsers */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .acfb-form input[type="text"],
    .acfb-form input[type="email"],
    .acfb-form input[type="tel"],
    .acfb-form input[type="date"],
    .acfb-form input[type="time"],
    .acfb-form select,
    .acfb-form textarea {
        background: #FFFFFF !important;
        background-color: #FFFFFF !important;
        color: #333333 !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        -webkit-text-fill-color: #333333 !important;
    }
}

/* Force color-scheme to light for the form to prevent browser dark mode interference */
.acfb-form {
    color-scheme: light;
}

.acfb-form input,
.acfb-form select,
.acfb-form textarea {
    color-scheme: light;
}
