/* ============================================
   FTA Design System - Variables
   ============================================ */
:root {
    --fta-navy: #002D62;
    --fta-gold: #C5A059;
    --bg-wash: #F8FAFC;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #E2E8F0;
    --input-bg: #ffffff;
    --readonly-bg: #F1F5F9;
    --danger: #dc2626;
}

/* ============================================
   Base
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-wash);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-top: 1rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--fta-navy);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 45, 98, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 2.5rem;
    max-width: 1100px;
    margin: 0 auto 1.5rem auto;
}

.card-section {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 45, 98, 0.06);
}

/* ============================================
   Section Title
   ============================================ */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

    .form-label .required {
        color: var(--danger);
        margin-left: 2px;
    }

    .form-label .optional {
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
        font-size: 0.65rem;
        color: #94a3b8;
    }

.form-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--input-bg);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-primary);
}

    .form-input:focus {
        outline: none;
        border-color: var(--fta-navy);
        box-shadow: 0 0 0 4px rgba(0, 45, 98, 0.05);
    }

    .form-input::placeholder {
        color: #94a3b8;
        font-size: 0.9rem;
    }

    .form-input.readonly,
    .form-input[readonly] {
        background-color: var(--readonly-bg);
        color: var(--text-secondary);
        cursor: not-allowed;
        border-color: #CBD5E1;
    }

/* ============================================
   Custom Dropdown
   ============================================ */
.custom-dropdown {
    position: relative;
}

.dropdown-input {
    position: relative;
}

    .dropdown-input .form-input {
        padding-right: 2.5rem;
        cursor: pointer;
    }

    .dropdown-input .clear-btn {
        position: absolute;
        right: 35px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        color: #94a3b8;
        font-size: 12px;
        z-index: 10;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s;
    }

        .dropdown-input .clear-btn:hover {
            background: #f1f5f9;
            color: #64748b;
        }

    .dropdown-input .arrow {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        color: #64748b;
        pointer-events: none;
        transition: transform 0.2s;
    }

.dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 45, 98, 0.12);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.15s;
}

    .dropdown-item:hover {
        background-color: #F0F7FF;
        color: var(--fta-navy);
    }

.no-data {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   Action Box (Radio Buttons)
   ============================================ */
.action-box {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

    .action-box:hover {
        border-color: var(--fta-gold);
    }

    .action-box:has(input:checked) {
        border-color: var(--fta-navy);
        background-color: #F0F7FF;
        box-shadow: 0 0 0 4px rgba(0, 45, 98, 0.05);
    }

.form-check-inline {
    margin-right: 1.5rem;
    display: inline-flex;
    align-items: center;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #CBD5E1;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
    accent-color: var(--fta-navy);
}

    .form-check-input:checked {
        background-color: var(--fta-navy);
        border-color: var(--fta-navy);
    }

.form-check-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
}

/* ============================================
   Checkbox
   ============================================ */
.form-check-input[type="checkbox"] {
    border-radius: 6px;
    width: 1.2rem;
    height: 1.2rem;
}

    .form-check-input[type="checkbox"]:checked {
        background-color: var(--fta-navy);
        border-color: var(--fta-navy);
    }

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background-color: var(--fta-navy);
    color: white;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 45, 98, 0.25);
}

    .btn-primary:hover:not(:disabled) {
        background-color: #003d82;
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(0, 45, 98, 0.35);
    }

    .btn-primary:disabled {
        background-color: #CBD5E1;
        cursor: not-allowed;
        box-shadow: none;
        color: #94a3b8;
    }

.submit-btn {
    background-color: var(--fta-navy);
    color: white;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 45, 98, 0.25);
}

    .submit-btn:hover:not(:disabled) {
        background-color: #003d82;
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(0, 45, 98, 0.35);
    }

    .submit-btn:disabled {
        background-color: #CBD5E1;
        cursor: not-allowed;
        box-shadow: none;
        color: #94a3b8;
    }

/* ============================================
   Error & Helpers
   ============================================ */
.text-danger {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.text-end {
    text-align: right;
}

.mt-2 {
    margin-top: 0.75rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2.5rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 2.5rem;
}

/* ============================================
   Loading Overlay
   ============================================ */
#ajax-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9998;
}

#ajax-loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 45, 98, 0.15);
    font-weight: 600;
    color: var(--fta-navy);
    font-size: 0.95rem;
    text-align: center;
}

    #ajax-loading::after {
        content: "";
        display: block;
        width: 30px;
        height: 30px;
        margin: 0.75rem auto 0;
        border: 3px solid #E2E8F0;
        border-top-color: var(--fta-navy);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

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

/* ============================================
   Animations
   ============================================ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* ============================================
   Grid Helpers (if Bootstrap is NOT loaded)
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-md-3,
.col-md-6,
.col-md-12,
.col-12 {
    padding: 0 0.75rem;
    flex: 0 0 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.g-3 {
    gap: 1.5rem 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .btn-primary,
    .submit-btn {
        width: 100%;
    }

    .text-end {
        text-align: center;
    }
}


/* ============================================
   Inline Alert Banner (Error / Success)
   ============================================ */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    animation: slideUp 0.3s ease-out;
}

.alert-banner.error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-banner.success {
    background-color: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.alert-text {
    flex: 1;
}

.alert-close {
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 0.25rem;
}

.alert-close:hover {
    opacity: 1;
}