/* Veterans Awards Form — Frontend (modern) */

.vaf-form-wrap {
    --vaf-bg: #ffffff;
    --vaf-surface: #f8fafc;
    --vaf-text: #0f172a;
    --vaf-text-soft: #64748b;
    --vaf-text-muted: #94a3b8;
    --vaf-border: #e2e8f0;
    --vaf-border-strong: #cbd5e1;
    --vaf-primary: #0f172a;
    --vaf-primary-hover: #1e293b;
    --vaf-accent: #2563eb;
    --vaf-accent-soft: #dbeafe;
    --vaf-success: #059669;
    --vaf-success-bg: #d1fae5;
    --vaf-error: #dc2626;
    --vaf-error-bg: #fef2f2;
    --vaf-error-border: #fecaca;
    --vaf-radius: 10px;
    --vaf-radius-sm: 6px;
    --vaf-radius-lg: 14px;
    --vaf-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --vaf-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --vaf-shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.12);

    max-width: 760px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--vaf-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vaf-form-wrap *,
.vaf-form-wrap *::before,
.vaf-form-wrap *::after {
    box-sizing: border-box;
}

/* Force the HTML `hidden` attribute to always win, regardless of theme button rules
   or our own `display: inline-flex` on .vaf-btn. */
.vaf-form-wrap [hidden] {
    display: none !important;
}

.vaf-intro {
    margin: 0 0 32px;
    color: var(--vaf-text-soft);
    font-size: 15px;
}

/* Progress header */
.vaf-progress-header {
    margin-bottom: 32px;
}

.vaf-step-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 16px;
    flex-wrap: wrap;
}

.vaf-step-counter {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vaf-text-muted);
}

.vaf-step-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--vaf-text);
    margin: 4px 0 0;
    line-height: 1.25;
    width: 100%;
}

.vaf-progress-bar {
    background: var(--vaf-border);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    position: relative;
}

.vaf-progress-fill {
    background: var(--vaf-text);
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Error summary */
.vaf-error-summary {
    background: var(--vaf-error-bg);
    border: 1px solid var(--vaf-error-border);
    color: var(--vaf-error);
    padding: 14px 18px;
    border-radius: var(--vaf-radius);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.vaf-error-summary::before {
    content: "!";
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--vaf-error);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

/* Steps */
.vaf-step {
    border: none;
    padding: 0;
    margin: 0;
    animation: vaf-fade-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes vaf-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.vaf-section-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vaf-text-muted);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--vaf-border);
}

.vaf-section-heading:first-child {
    margin-top: 0;
}

/* Grid */
.vaf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}

@media (max-width: 640px) {
    .vaf-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Fields */
.vaf-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

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

.vaf-field label,
.vaf-block-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--vaf-text);
    line-height: 1.4;
}

.vaf-req {
    color: var(--vaf-error);
    font-weight: 400;
    margin-left: 2px;
}

.vaf-field input[type="text"],
.vaf-field input[type="email"],
.vaf-field input[type="tel"],
.vaf-field input[type="number"],
.vaf-field input[type="url"],
.vaf-field select,
.vaf-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--vaf-border-strong);
    border-radius: var(--vaf-radius-sm);
    font-size: 15px;
    background: var(--vaf-bg);
    font-family: inherit;
    color: var(--vaf-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
}

.vaf-field 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' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.vaf-field input[type="file"] {
    padding: 10px 0;
    font-size: 14px;
    border: none;
    color: var(--vaf-text-soft);
    background: transparent;
}

.vaf-field input[type="file"]::file-selector-button {
    border: 1px solid var(--vaf-border-strong);
    background: var(--vaf-bg);
    padding: 8px 14px;
    border-radius: var(--vaf-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--vaf-text);
    cursor: pointer;
    margin-right: 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.vaf-field input[type="file"]::file-selector-button:hover {
    background: var(--vaf-surface);
    border-color: var(--vaf-text);
}

.vaf-field input:focus,
.vaf-field select:focus,
.vaf-field textarea:focus {
    outline: none;
    border-color: var(--vaf-accent);
    box-shadow: var(--vaf-shadow-focus);
}

.vaf-field input.vaf-invalid,
.vaf-field select.vaf-invalid,
.vaf-field textarea.vaf-invalid {
    border-color: var(--vaf-error);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.vaf-field textarea {
    resize: vertical;
    min-height: 120px;
}

.vaf-field input::placeholder,
.vaf-field textarea::placeholder {
    color: var(--vaf-text-muted);
}

.vaf-help {
    font-size: 13px;
    color: var(--vaf-text-soft);
    margin: 8px 0 0;
    line-height: 1.5;
}

/* Radio / Checkbox */
.vaf-radio-label,
.vaf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 400;
    font-size: 15px;
    cursor: pointer;
    padding: 12px 14px;
    color: var(--vaf-text);
    border: 1px solid var(--vaf-border);
    border-radius: var(--vaf-radius-sm);
    margin-bottom: 8px;
    background: var(--vaf-bg);
    transition: background 0.15s ease, border-color 0.15s ease;
    line-height: 1.4;
}

.vaf-radio-label:hover,
.vaf-checkbox-label:hover {
    background: var(--vaf-surface);
    border-color: var(--vaf-border-strong);
}

.vaf-radio-label input[type="radio"],
.vaf-checkbox-label input[type="checkbox"] {
    margin: 2px 0 0 0;
    flex-shrink: 0;
    accent-color: var(--vaf-text);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.vaf-radio-label:has(input:checked),
.vaf-checkbox-label:has(input:checked) {
    background: var(--vaf-accent-soft);
    border-color: var(--vaf-accent);
}

/* Category info card */
.vaf-cat-description {
    background: var(--vaf-surface);
    padding: 18px 20px;
    border-radius: var(--vaf-radius);
    margin-top: 18px;
    color: var(--vaf-text);
    font-size: 14px;
    line-height: 1.65;
    border: 1px solid var(--vaf-border);
}

.vaf-cat-eligibility {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-left-width: 4px;
    border-left-color: #f59e0b;
    padding: 14px 18px;
    border-radius: var(--vaf-radius);
    margin-top: 12px;
    font-size: 14px;
    color: #78350f;
    line-height: 1.55;
}

.vaf-cat-eligibility strong {
    color: #92400e;
}

/* File preview */
.vaf-file-preview {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--vaf-text-soft);
}

.vaf-file-preview li {
    padding: 8px 14px;
    background: var(--vaf-surface);
    border: 1px solid var(--vaf-border);
    border-radius: var(--vaf-radius-sm);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vaf-file-preview li::before {
    content: "📄";
    font-size: 14px;
}

/* Actions */
.vaf-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--vaf-border);
    gap: 12px;
}

.vaf-btn {
    padding: 12px 24px;
    border-radius: var(--vaf-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    line-height: 1.2;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vaf-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.vaf-btn-secondary {
    background: var(--vaf-bg);
    color: var(--vaf-text);
    border-color: var(--vaf-border-strong);
}

.vaf-btn-secondary:hover:not(:disabled) {
    background: var(--vaf-surface);
    border-color: var(--vaf-text);
}

.vaf-btn-primary {
    background: var(--vaf-primary);
    color: #ffffff;
    margin-left: auto;
    box-shadow: var(--vaf-shadow-sm);
}

.vaf-btn-primary:hover:not(:disabled) {
    background: var(--vaf-primary-hover);
    box-shadow: var(--vaf-shadow-md);
    transform: translateY(-1px);
}

.vaf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

#vaf-prev + #vaf-next,
#vaf-prev + #vaf-submit {
    margin-left: auto;
}

/* Success */
.vaf-success {
    background: var(--vaf-success-bg);
    border: 1px solid #a7f3d0;
    padding: 40px 32px;
    border-radius: var(--vaf-radius-lg);
    text-align: center;
    color: #064e3b;
    animation: vaf-fade-in 0.4s ease;
}

.vaf-success::before {
    content: "✓";
    display: block;
    margin: 0 auto 16px;
    width: 56px;
    height: 56px;
    background: var(--vaf-success);
    color: #ffffff;
    border-radius: 50%;
    line-height: 56px;
    font-size: 28px;
    font-weight: 700;
}

.vaf-success h2 {
    margin: 0 0 12px;
    color: #064e3b;
    font-size: 24px;
    font-weight: 700;
}

.vaf-success p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #065f46;
}

.vaf-empty {
    padding: 32px;
    background: var(--vaf-surface);
    border: 1px solid var(--vaf-border);
    border-radius: var(--vaf-radius);
    text-align: center;
    color: var(--vaf-text-soft);
}

/* Small viewport tweaks */
@media (max-width: 520px) {
    .vaf-step-title {
        font-size: 19px;
    }
    .vaf-btn {
        padding: 11px 18px;
        font-size: 14px;
    }
    .vaf-actions {
        flex-direction: column-reverse;
    }
    .vaf-btn-primary {
        margin-left: 0;
        width: 100%;
    }
    .vaf-btn-secondary {
        width: 100%;
    }
}
