/**
 * Little Journeys Application Form - Frontend CSS
 * Elegant luxury design with serif headers and clean inputs
 */

/* ========================================
   CSS VARIABLES
   ======================================== */

.ljaf-form-wrapper {
    --ljaf-primary: #5DBCC4;
    --ljaf-primary-dark: #4aa8b0;
    --ljaf-charcoal: #1C1C1C;
    --ljaf-charcoal-light: #3a3a3a;
    --ljaf-gray: #666666;
    --ljaf-gray-light: #999999;
    --ljaf-border: #e0e0e0;
    --ljaf-background: #fafafa;
    --ljaf-cream: #f8f6f3;
    --ljaf-white: #ffffff;
    --ljaf-success: #4caf50;
    --ljaf-error: #f44336;
    --ljaf-font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --ljaf-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   FORM WRAPPER
   ======================================== */

.ljaf-form-wrapper {
    font-family: var(--ljaf-font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ljaf-charcoal);
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.ljaf-form-wrapper * {
    box-sizing: border-box;
}

/* ========================================
   FORM HEADER
   ======================================== */

.ljaf-form-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--ljaf-border);
}

.ljaf-form-title {
    font-family: var(--ljaf-font-serif);
    font-size: 36px;
    font-weight: 500;
    color: var(--ljaf-charcoal);
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.ljaf-form-subtitle {
    font-size: 14px;
    color: var(--ljaf-gray-light);
    margin: 0;
    letter-spacing: 0.5px;
}

/* ========================================
   SECTIONS
   ======================================== */

.ljaf-section {
    margin-bottom: 45px;
    padding-bottom: 45px;
    border-bottom: 1px solid var(--ljaf-border);
}

.ljaf-section:last-of-type {
    border-bottom: none;
    margin-bottom: 30px;
}

.ljaf-section-title {
    font-family: var(--ljaf-font-serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--ljaf-charcoal);
    margin: 0 0 25px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ljaf-primary);
}

.ljaf-parent-section {
    background: var(--ljaf-cream);
    padding: 30px;
    border-radius: 8px;
    border: none;
    margin-bottom: 25px;
}

.ljaf-parent-section .ljaf-section-title {
    margin-top: 0;
}

.ljaf-subsection {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px dashed var(--ljaf-border);
}

.ljaf-subsection-title {
    font-family: var(--ljaf-font-serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--ljaf-gray);
    margin: 0 0 20px 0;
}

/* ========================================
   FIELD ROWS
   ======================================== */

.ljaf-field-row {
    margin-bottom: 20px;
}

.ljaf-field-row:last-child {
    margin-bottom: 0;
}

.ljaf-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.ljaf-three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.ljaf-four-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ljaf-address-row {
    display: grid !important;
    grid-template-columns: 2fr 1fr 100px !important;
    gap: 20px !important;
}

.ljaf-address-row-with-state {
    display: grid !important;
    grid-template-columns: 2fr 1fr 80px 100px !important;
    gap: 15px !important;
}

.ljaf-field-state {
    min-width: 80px;
}

.ljaf-field-street {
    min-width: 200px;
}

.ljaf-field-city {
    min-width: 120px;
}

.ljaf-field-zip {
    min-width: 80px;
}

/* ========================================
   FIELDS
   ======================================== */

.ljaf-field {
    display: flex;
    flex-direction: column;
}

.ljaf-field-full {
    width: 100%;
}

.ljaf-field label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ljaf-gray);
    margin-bottom: 8px;
}

.ljaf-field label .required {
    color: var(--ljaf-error);
    margin-left: 2px;
}

.ljaf-field label .optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ljaf-gray-light);
    font-size: 12px;
}

/* ========================================
   INPUTS
   ======================================== */

.ljaf-form input[type="text"],
.ljaf-form input[type="email"],
.ljaf-form input[type="tel"],
.ljaf-form input[type="date"],
.ljaf-form input[type="time"],
.ljaf-form input[type="number"],
.ljaf-form select,
.ljaf-form textarea {
    width: 100%;
    padding: 12px 0;
    font-family: var(--ljaf-font-sans);
    font-size: 15px;
    color: var(--ljaf-charcoal);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ljaf-border);
    border-radius: 0;
    outline: none;
    transition: border-color 0.3s ease;
}

.ljaf-form input:focus,
.ljaf-form select:focus,
.ljaf-form textarea:focus {
    border-bottom-color: var(--ljaf-primary);
}

.ljaf-form input::placeholder,
.ljaf-form textarea::placeholder {
    color: var(--ljaf-gray-light);
}

.ljaf-form textarea {
    min-height: 80px;
    resize: vertical;
}

.ljaf-form select {
    cursor: pointer;
    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");
    background-repeat: no-repeat;
    background-position: right 5px center;
    padding-right: 25px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ========================================
   RADIO & CHECKBOX
   ======================================== */

.ljaf-radio-group,
.ljaf-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 5px;
}

.ljaf-radio-inline {
    gap: 30px;
}

.ljaf-radio-label,
.ljaf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ljaf-charcoal);
}

.ljaf-radio-label input,
.ljaf-checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--ljaf-primary);
}

.ljaf-checkbox-single {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ljaf-charcoal);
}

.ljaf-checkbox-single input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--ljaf-primary);
}

.ljaf-inline-input {
    width: 200px !important;
    display: inline-block;
    margin-left: 10px;
}

/* ========================================
   SCHEDULE TABLE
   ======================================== */

.ljaf-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.ljaf-schedule-table th,
.ljaf-schedule-table td {
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
}

.ljaf-schedule-table thead th {
    font-weight: 500;
    color: var(--ljaf-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    padding-bottom: 15px;
}

.ljaf-schedule-table tbody th {
    text-align: left;
    font-weight: 500;
    color: var(--ljaf-charcoal);
}

.ljaf-schedule-table input[type="time"] {
    padding: 8px 5px;
    text-align: center;
    border: 1px solid var(--ljaf-border);
    border-radius: 4px;
    font-size: 13px;
}

.ljaf-schedule-table input[type="time"]:focus {
    border-color: var(--ljaf-primary);
}

/* ========================================
   CONDITIONAL FIELDS
   ======================================== */

.ljaf-conditional-field {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: var(--ljaf-white);
    border-radius: 6px;
    border: 1px solid var(--ljaf-border);
}

.ljaf-conditional-field.ljaf-visible {
    display: block;
}

.ljaf-conditional-field label {
    display: block;
    margin-bottom: 8px;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.ljaf-form-footer {
    margin-top: 40px;
    text-align: center;
}

.ljaf-submit-btn {
    display: inline-block;
    padding: 18px 60px;
    font-family: var(--ljaf-font-sans);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ljaf-white);
    background: var(--ljaf-charcoal);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ljaf-submit-btn:hover {
    background: var(--ljaf-charcoal-light);
    transform: translateY(-2px);
}

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

/* ========================================
   MESSAGES
   ======================================== */

.ljaf-form-messages {
    margin-top: 25px;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
}

.ljaf-form-messages.ljaf-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.ljaf-form-messages.ljaf-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

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

@media (max-width: 768px) {
    .ljaf-form-wrapper {
        padding: 15px;
    }
    
    .ljaf-form-title {
        font-size: 28px;
    }
    
    .ljaf-two-col,
    .ljaf-three-col,
    .ljaf-four-col {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Address rows stay in one row but adjust proportions */
    .ljaf-address-row {
        grid-template-columns: 1.5fr 1fr 90px !important;
        gap: 10px !important;
    }
    
    .ljaf-address-row-with-state {
        grid-template-columns: 1.5fr 1fr 70px 80px !important;
        gap: 10px !important;
    }
    
    .ljaf-parent-section {
        padding: 20px;
    }
    
    .ljaf-radio-group,
    .ljaf-checkbox-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .ljaf-schedule-table {
        font-size: 12px;
    }
    
    .ljaf-schedule-table th,
    .ljaf-schedule-table td {
        padding: 8px 4px;
    }
    
    .ljaf-submit-btn {
        width: 100%;
        padding: 16px 30px;
    }
    
    .ljaf-inline-input {
        width: 100% !important;
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Very small screens - keep address in one row but more compact */
@media (max-width: 480px) {
    .ljaf-address-row-with-state {
        grid-template-columns: 1fr 1fr 60px 70px !important;
        gap: 8px !important;
    }
    
    .ljaf-address-row-with-state .ljaf-field label,
    .ljaf-address-row .ljaf-field label {
        font-size: 10px !important;
    }
    
    .ljaf-address-row-with-state .ljaf-field input,
    .ljaf-address-row .ljaf-field input {
        padding: 10px 8px !important;
        font-size: 13px !important;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.ljaf-form.ljaf-loading {
    pointer-events: none;
    opacity: 0.7;
}

.ljaf-form.ljaf-loading .ljaf-submit-btn {
    position: relative;
}

.ljaf-form.ljaf-loading .ljaf-btn-text {
    visibility: hidden;
}

.ljaf-form.ljaf-loading .ljaf-btn-loading {
    display: inline-block !important;
}
