/* ══════════════════════════════════════════════════
   APPLICATION FLOW — mobile-first, scoped under .af-
   Reuses tokens from styles.css, never touches the
   shared .form-* classes used by the site contact form.
   ══════════════════════════════════════════════════ */

.af-section {
    padding: 96px 5% 40px;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.af-shell {
    width: 100%;
    max-width: 640px;
}

.af-card {
    background: #fff;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 28px 20px 24px;
}

/* ── PROGRESS ── */
.af-progress-track {
    height: 3px;
    background: var(--border-light);
    width: 100%;
    margin-bottom: 16px;
    position: relative;
}

.af-progress-fill {
    height: 100%;
    width: 33.3%;
    background: var(--accent-gold);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.af-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 28px;
}

.af-step-count {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: var(--accent-primary);
    letter-spacing: 0.5px;
}

.af-step-count i {
    font-style: normal;
    color: var(--text-light);
    font-size: 12px;
}

.af-step-name {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    font-weight: 500;
}

/* ── STEP CONTENT ── */
.af-step {
    animation: afStepIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes afStepIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.af-title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 14px;
}

.af-step-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.af-sub {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* ── FIELDS ── */
.af-field {
    margin-bottom: 18px;
}

.af-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.af-field label i {
    font-style: normal;
    color: var(--text-light);
    font-weight: 300;
}

.af-input {
    width: 100%;
    padding: 15px 14px;
    font-size: 16px;
    /* 16px prevents iOS auto-zoom on focus */
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 0;
    min-height: 52px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.af-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #fff;
}

.af-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23495057' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.af-textarea {
    min-height: 96px;
    resize: vertical;
}

/* ── PHONE (country picker + number) ── */
.af-phone-group {
    display: flex;
    gap: 10px;
    position: relative;
}

.af-phone-number {
    flex: 1;
    min-width: 0;
}

.af-country-picker {
    position: relative;
    flex: 0 0 auto;
}

.af-country-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 118px;
    min-height: 52px;
    cursor: pointer;
    color: var(--text-main);
}

.af-country-flag {
    font-size: 18px;
    line-height: 1;
}

.af-country-dial {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-caret {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.af-country-trigger[aria-expanded="true"] .af-caret {
    transform: rotate(180deg);
}

.af-country-trigger:focus-visible {
    outline: none;
    border-color: var(--accent-primary);
}

/* Dropdown panel */
.af-country-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, 82vw);
    max-height: 320px;
    background: #fff;
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

/* Author rules always beat the UA [hidden]{display:none} default at
   equal specificity, so visibility must be driven explicitly here —
   otherwise the panel renders regardless of the hidden attribute. */
.af-country-panel[hidden] {
    display: none;
}

.af-country-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
}

.af-country-search {
    width: 100%;
    padding: 13px 14px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: none;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.af-country-search:focus {
    outline: none;
    background: #fff;
}

.af-country-list {
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.af-country-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
}

.af-country-list li .af-country-flag {
    font-size: 16px;
}

.af-country-list li .af-country-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.af-country-list li .af-country-code {
    color: var(--text-light);
    font-size: 12px;
    flex-shrink: 0;
}

.af-country-list li:hover,
.af-country-list li.is-active {
    background: var(--bg-secondary);
}

.af-country-list li.is-empty {
    color: var(--text-light);
    cursor: default;
    justify-content: center;
    padding: 20px 14px;
}

.af-phone-code-other {
    margin-top: 10px;
}

/* Full-width picker + bottom-sheet style panel on small phones */
@media (max-width: 480px) {
    .af-country-panel {
        position: fixed;
        left: 5%;
        right: 5%;
        top: auto;
        bottom: 5%;
        width: auto;
        max-height: 60vh;
    }
}

.af-field.has-error .af-input {
    border-color: #c0392b;
    background: #fff;
}

.af-error {
    display: none;
    font-size: 12px;
    color: #c0392b;
    margin-top: 6px;
}

.af-field.has-error .af-error {
    display: block;
}

/* ── CONSENT ── */
.af-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0 4px;
}

.af-consent input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent-primary);
}

.af-consent label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.af-consent .af-error {
    flex-basis: 100%;
    margin-left: 32px;
}

/* ── ACTIONS (thumb-reachable on mobile) ── */
.af-actions {
    margin-top: 24px;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 14px;
    padding-bottom: 4px;
}

.af-actions-split {
    display: flex;
    gap: 12px;
}

.af-actions-split .btn {
    flex: 1;
}

.af-btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── SUCCESS STATE ── */
.af-success {
    text-align: center;
    padding: 20px 4px 8px;
}

.af-success-icon {
    width: 52px;
    height: 52px;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
}

.af-success h2 {
    font-size: 24px;
    margin-bottom: 14px;
}

.af-success p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ══════════════════════════════════════════════════
   TABLET / DESKTOP — progressive enhancement only
   ══════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .af-section {
        padding: 140px 5% 80px;
    }

    .af-card {
        padding: 48px 48px 40px;
    }

    .af-title {
        font-size: 34px;
    }

    .af-actions {
        position: static;
        padding-top: 8px;
    }

    .af-btn-full {
        width: auto;
        padding-left: 48px;
        padding-right: 48px;
    }
}

@media (min-width: 1024px) {
    .af-card {
        padding: 60px;
    }
}