/* ============================================================
   BAFA 2027 Application Forms — forms.css
   ============================================================ */

/* ── Page wrapper ── */
.baf-page { background: var(--cream, #faf6f0); min-height: 60vh; }

.baf-page-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

/* ── Form introduction ── */
.baf-intro { margin-bottom: 2.5rem; }

.baf-intro__badge {
    display: inline-block;
    background: var(--gold, #d4a017);
    color: var(--deep-black, #0a0a0a);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3em 0.9em;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.baf-intro__heading {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.25;
    color: var(--deep-black, #0a0a0a);
    margin: 0 0 1.25rem;
}

.baf-intro__text { color: #3a3530; line-height: 1.75; }
.baf-intro__text p { margin: 0 0 1em; }
.baf-intro__text p:last-child { margin-bottom: 0; }

.baf-required-note {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 2rem;
}
.baf-required-note em { color: var(--gold, #d4a017); font-style: normal; font-weight: 700; }

/* ── Form sections ── */
.baf-section {
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.baf-section__title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--deep-black, #0a0a0a);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold, #d4a017);
}

/* ── Fields ── */
.baf-field { margin-bottom: 1.5rem; }
.baf-field:last-child { margin-bottom: 0; }

.baf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) { .baf-row { grid-template-columns: 1fr; } }

.baf-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--deep-black, #0a0a0a);
    margin-bottom: 0.4rem;
}

.baf-label-hint {
    font-weight: 400;
    color: #666;
    font-size: 0.85em;
}

.baf-required { color: var(--gold, #d4a017); margin-left: 2px; }

.baf-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* ── Inputs ── */
.baf-input,
.baf-textarea,
.baf-select {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #d5ccc0;
    border-radius: 6px;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.95rem;
    color: var(--deep-black, #0a0a0a);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.baf-input:focus,
.baf-textarea:focus,
.baf-select:focus {
    outline: none;
    border-color: var(--gold, #d4a017);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}

.baf-input.baf-input--short { max-width: 160px; }

.baf-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.baf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* ── Word count ── */
.baf-word-count {
    font-size: 0.78rem;
    color: #888;
    text-align: right;
    margin-top: 0.3rem;
}
.baf-word-count--over { color: #c0392b; font-weight: 600; }

/* ── Fieldset reset (browser default adds visible border + legend-on-border) ── */
.baf-form fieldset,
.baf-modal-content fieldset {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.baf-form fieldset legend,
.baf-modal-content fieldset legend {
    display: table; /* full-width block without float side-effects */
    width: 100%;
    padding: 0;
    margin-bottom: 0.5rem;
}

/* ── Radio / checkbox groups ── */
.baf-options { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.baf-options--stack { flex-direction: column; gap: 0.5rem; }

.baf-radio-label,
.baf-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--deep-black, #0a0a0a);
    line-height: 1.4;
}

.baf-radio-label input[type="radio"],
.baf-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--gold, #d4a017);
    cursor: pointer;
}

/* ── Multi-select checkboxes ── */
.baf-multi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ── File upload ── */
.baf-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    border: 2px dashed #d5ccc0;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fdf9f4;
    min-height: 90px;
}

.baf-upload-area:hover,
.baf-upload-area:focus-within {
    border-color: var(--gold, #d4a017);
    background: #fffbf2;
}

.baf-upload-area svg { color: var(--gold, #d4a017); margin-bottom: 0.4rem; }

.baf-upload-label-text {
    font-size: 0.88rem;
    color: #555;
}

.baf-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.baf-upload-hint {
    font-size: 0.78rem;
    color: #888;
    margin: 0.5rem 0 0;
}

/* ── Conditional sections ── */
.baf-conditional[hidden] { display: none; }

/* ── Declaration / consent ── */
.baf-declaration {
    background: #f5ede0;
    border-left: 4px solid var(--gold, #d4a017);
    border-radius: 6px;
    padding: 1.25rem 1.4rem;
    margin-top: 2rem;
}

.baf-declaration p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #3a3530;
    margin: 0 0 1rem;
}
.baf-declaration p:last-of-type { margin-bottom: 1.25rem; }

.baf-consent-checks { display: flex; flex-direction: column; gap: 0.75rem; }

.baf-check-label--mandatory { font-weight: 600; }

/* ── Submit ── */
.baf-actions { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.baf-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--deep-black, #0a0a0a);
    color: #fff;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.baf-submit-btn:hover { background: var(--gold, #d4a017); color: var(--deep-black, #0a0a0a); }
.baf-submit-btn:active { transform: scale(0.98); }
.baf-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Inline error ── */
.baf-submit-error {
    font-size: 0.85rem;
    color: #c0392b;
    background: #fdf0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    margin-top: 0.75rem;
    width: 100%;
}

/* ── Success state ── */
.baf-success {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 10px;
}

.baf-success__icon {
    width: 64px;
    height: 64px;
    background: var(--gold, #d4a017);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #fff;
}

.baf-success__heading {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.75rem;
    color: var(--deep-black, #0a0a0a);
    margin: 0 0 1rem;
}

.baf-success__body {
    font-size: 0.95rem;
    color: #3a3530;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 2rem;
}

.baf-reference-block {
    display: inline-block;
    background: var(--cream, #faf6f0);
    border: 2px solid var(--gold, #d4a017);
    border-radius: 8px;
    padding: 0.75rem 2rem;
    margin: 1rem 0 1.5rem;
}

.baf-reference-block__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    display: block;
    margin-bottom: 0.25rem;
}

.baf-reference {
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--deep-black, #0a0a0a);
    letter-spacing: 0.05em;
}

.baf-success__home {
    display: inline-block;
    background: var(--deep-black, #0a0a0a);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background 0.2s;
}
.baf-success__home:hover { background: var(--gold, #d4a017); color: var(--deep-black, #0a0a0a); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .baf-page-inner { padding: 2rem 1rem 3.5rem; }
    .baf-section { padding: 1.25rem 1rem; }
    .baf-multi-grid { grid-template-columns: 1fr; }
    .baf-actions { flex-direction: column; align-items: flex-start; }
    .baf-submit-btn { width: 100%; justify-content: center; }
}
