/* ============================================================
   ACT FINANCE — Order Form (Multi-Step)
   ============================================================ */

:root {
    --afo-blue:    #0060ff;
    --afo-blue-d:  #0050d8;
    --afo-navy:    #0a0e3d;
    --afo-success: #16a34a;
    --afo-error:   #ef4444;
    --afo-gray:    #64748b;
    --afo-border:  #d1d9e8;
    --afo-bg:      #f8fafc;
    --afo-white:   #ffffff;
    --afo-radius:  14px;
    --afo-shadow:  0 4px 28px rgba(0,0,0,.09);
    --afo-trans:   0.28s cubic-bezier(.4,0,.2,1);
}

/* ── WRAPPER ── */
.afo-wrap {
    max-width: 760px;
    margin: 0 auto;
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
}

/* ── PROGRESS BAR ── */
.afo-progress {
    margin-bottom: 36px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--afo-trans), transform var(--afo-trans);
    pointer-events: none;
}
.afo-progress.visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.afo-progress-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
}
.afo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--afo-blue), #4d8dff);
    border-radius: 99px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    width: 0%;
}
.afo-steps-labels {
    display: flex;
    justify-content: space-between;
}
.afo-step-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    transition: color var(--afo-trans);
    cursor: default;
    position: relative;
}
.afo-step-label.active  { color: var(--afo-blue); }
.afo-step-label.done    { color: var(--afo-success); }

/* ── SCREENS ── */
.afo-screen {
    display: none;
    animation: afo-fade-in .32s ease both;
}
.afo-screen.active { display: block; }

@keyframes afo-fade-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: none; }
}
@keyframes afo-fade-back {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: none; }
}
.afo-screen.going-back { animation: afo-fade-back .32s ease both; }

/* ── AUTH SCREEN ── */
.afo-auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.afo-auth-icon {
    display: inline-flex;
    margin-bottom: 16px;
}
.afo-auth-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--afo-navy);
    margin: 0 0 8px;
    line-height: 1.2;
}
.afo-auth-sub {
    font-size: 15px;
    color: var(--afo-gray);
    margin: 0;
}
.afo-logged-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--afo-radius);
    padding: 14px 18px;
    font-size: 14px;
    color: #15803d;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── AUTH CARDS ── */
.afo-auth-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}
.afo-auth-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--afo-white);
    border: 1.5px solid var(--afo-border);
    border-radius: var(--afo-radius);
    padding: 18px 20px;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--afo-trans), box-shadow var(--afo-trans), transform var(--afo-trans);
    width: 100%;
}
.afo-auth-card:hover {
    border-color: var(--afo-blue);
    box-shadow: 0 4px 18px rgba(0,96,255,.12);
    transform: translateY(-2px);
}
.afo-auth-card-guest { background: var(--afo-bg); }
.afo-auth-card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.afo-icon-blue   { background: #eef4ff; }
.afo-icon-purple { background: #f5f3ff; }
.afo-icon-gray   { background: #f1f5f9; }
.afo-auth-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.afo-auth-card-text strong { font-size: 15px; color: #1a1a2e; font-weight: 700; }
.afo-auth-card-text span   { font-size: 13px; color: var(--afo-gray); }
.afo-auth-card-arrow { font-size: 18px; color: #94a3b8; transition: transform var(--afo-trans); }
.afo-auth-card:hover .afo-auth-card-arrow { transform: translateX(4px); color: var(--afo-blue); }
.afo-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── AUTH SUB-FORMS ── */
.afo-auth-sub-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    animation: afo-fade-in .25s ease both;
}
.afo-auth-sub-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.afo-auth-sub-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.afo-auth-switch {
    font-size: 13px;
    color: var(--afo-gray);
    margin-top: 14px;
    text-align: center;
}

/* ── SCREEN HEADER ── */
.afo-screen-header {
    margin-bottom: 28px;
}
.afo-step-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--afo-blue);
    background: #eef4ff;
    border-radius: 6px;
    padding: 3px 10px;
    margin-bottom: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.afo-screen-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--afo-navy);
    margin: 0 0 6px;
}
.afo-screen-header p {
    font-size: 14px;
    color: var(--afo-gray);
    margin: 0;
}

/* ── FIELDS ── */
.afo-fields { margin-bottom: 28px; }

.afo-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.afo-field-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.afo-field-group { display: flex; flex-direction: column; gap: 6px; }
.afo-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: .01em;
}
.afo-field-group small {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: -2px;
}
.req       { color: var(--afo-error); }
.afo-optional { font-weight: 400; color: #94a3b8; font-size: 12px; }

.afo-field-group input[type="text"],
.afo-field-group input[type="email"],
.afo-field-group input[type="tel"],
.afo-field-group input[type="number"],
.afo-field-group input[type="password"],
.afo-field-group textarea,
.afo-field-group select {
    width: 100%;
    border: 1.5px solid var(--afo-border);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    background: var(--afo-bg);
    transition: border-color var(--afo-trans), box-shadow var(--afo-trans), background var(--afo-trans);
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.afo-field-group input::placeholder,
.afo-field-group textarea::placeholder { color: #b0bac9; font-size: 13px; }
.afo-field-group input:focus,
.afo-field-group textarea:focus,
.afo-field-group select:focus {
    border-color: var(--afo-blue);
    background: var(--afo-white);
    box-shadow: 0 0 0 3px rgba(0,96,255,.1);
}
.afo-field-group input.has-error,
.afo-field-group select.has-error,
.afo-field-group textarea.has-error { border-color: var(--afo-error) !important; }
.afo-field-group textarea { resize: vertical; line-height: 1.6; min-height: 90px; }

/* Select wrapper */
.afo-select-wrap { position: relative; }
.afo-select-wrap select { padding-right: 36px; cursor: pointer; }
.afo-select-arrow {
    position: absolute;
    right: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--afo-gray);
    pointer-events: none;
    font-size: 14px;
}

/* Input + eye icon */
.afo-input-eye { position: relative; }
.afo-input-eye input { padding-right: 42px; }
.afo-eye-btn {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; padding: 4px;
    color: #94a3b8;
    display: flex; align-items: center;
}

/* Field errors */
.afo-field-error {
    font-size: 12px;
    color: var(--afo-error);
    min-height: 16px;
    display: block;
}
.afo-auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ── RADIO CARDS ── */
.afo-radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}
.afo-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--afo-white);
    border: 1.5px solid var(--afo-border);
    border-radius: 12px;
    padding: 16px 15px;
    cursor: pointer;
    transition: border-color var(--afo-trans), box-shadow var(--afo-trans);
    position: relative;
}
.afo-radio-card input[type="radio"] { display: none; }
.afo-radio-card.selected {
    border-color: var(--afo-blue);
    box-shadow: 0 0 0 3px rgba(0,96,255,.1);
    background: #f8faff;
}
.afo-radio-card-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.afo-radio-card-inner strong { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.afo-radio-card-inner span   { font-size: 12px; color: var(--afo-gray); }
.afo-price-tag {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--afo-blue) !important;
    margin-top: 4px;
}
.afo-radio-check {
    position: absolute;
    top: 10px; right: 12px;
    width: 20px; height: 20px;
    background: var(--afo-blue);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--afo-trans);
}
.afo-radio-card.selected .afo-radio-check { opacity: 1; }

/* ── QTY CONTROL ── */
.afo-qty-group { align-items: flex-start; }
.afo-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--afo-border);
    border-radius: 10px;
    overflow: hidden;
    width: fit-content;
    background: var(--afo-bg);
}
.afo-qty-btn {
    width: 42px; height: 44px;
    background: none; border: none;
    font-size: 20px; font-weight: 300;
    color: var(--afo-blue);
    cursor: pointer;
    transition: background var(--afo-trans);
    display: flex; align-items: center; justify-content: center;
}
.afo-qty-btn:hover { background: #eef4ff; }
.afo-qty-control input {
    width: 64px; height: 44px;
    border: none !important;
    border-left: 1.5px solid var(--afo-border) !important;
    border-right: 1.5px solid var(--afo-border) !important;
    border-radius: 0 !important;
    background: var(--afo-white) !important;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ── PRICE SUMMARY ── */
.afo-price-summary {
    background: linear-gradient(135deg, #f0f6ff, #eef4ff);
    border: 1px solid #c7dcff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 20px;
}
.afo-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #374151;
    padding: 5px 0;
}
.afo-price-row-tax { color: var(--afo-gray); font-size: 13px; }
.afo-price-total {
    font-size: 17px;
    font-weight: 800;
    color: var(--afo-navy);
    border-top: 1px solid #c7dcff;
    margin-top: 8px;
    padding-top: 10px;
}
.afo-price-total span:last-child { color: var(--afo-blue); }

/* ── RECAP ── */
.afo-recap {
    background: var(--afo-white);
    border: 1.5px solid var(--afo-border);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.afo-recap-item { display: flex; flex-direction: column; gap: 3px; }
.afo-recap-item .afo-ri-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; }
.afo-recap-item .afo-ri-val   { font-size: 14px; color: #1a1a2e; font-weight: 500; }
.afo-recap-divider { grid-column: 1 / -1; border: none; border-top: 1px solid #e2e8f0; margin: 4px 0; }

/* ── CGV ── */
.afo-cgv-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    line-height: 1.55;
    margin-bottom: 6px;
}
.afo-cgv-label input { margin-top: 3px; accent-color: var(--afo-blue); width: 16px; height: 16px; flex-shrink: 0; }
.afo-cgv-label a { color: var(--afo-blue); text-decoration: underline; }

/* ── PAYMENT ── */
.afo-payment-methods { margin-top: 20px; }
.afo-payment-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 10px; }
.afo-payment-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.afo-pay-card {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--afo-border);
    border-radius: 10px;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: border-color var(--afo-trans), box-shadow var(--afo-trans);
    user-select: none;
}
.afo-pay-card input { display: none; }
.afo-pay-card.selected {
    border-color: var(--afo-blue);
    box-shadow: 0 0 0 3px rgba(0,96,255,.1);
    color: var(--afo-blue);
    background: #f8faff;
}
.afo-bank-info {
    margin-top: 14px;
    animation: afo-fade-in .25s ease;
}
.afo-bank-info-inner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.7;
}

/* ── NAV BUTTONS ── */
.afo-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}
.afo-nav-submit { border-top: none; padding-top: 0; margin-top: 20px; }

/* ── BUTTONS ── */
.afo-btn-primary,
.afo-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--afo-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 26px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--afo-trans), transform var(--afo-trans), box-shadow var(--afo-trans);
    letter-spacing: .02em;
    box-shadow: 0 4px 14px rgba(0,96,255,.3);
    text-decoration: none;
}
.afo-btn-cta {
    padding: 14px 34px;
    font-size: 15px;
    background: linear-gradient(135deg, var(--afo-blue), #0050d8);
    box-shadow: 0 4px 18px rgba(0,96,255,.4);
}
.afo-btn-primary:hover,
.afo-btn-cta:hover {
    background: var(--afo-blue-d);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0,96,255,.4);
}
.afo-btn-full { width: 100%; justify-content: center; }
.afo-arrow { transition: transform var(--afo-trans); }
.afo-btn-primary:hover .afo-arrow { transform: translateX(3px); }

.afo-btn-ghost {
    background: none;
    border: 1.5px solid var(--afo-border);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--afo-gray);
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--afo-trans), color var(--afo-trans);
}
.afo-btn-ghost:hover { border-color: #94a3b8; color: #374151; }

.afo-btn-link {
    background: none; border: none;
    color: var(--afo-blue);
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.afo-btn-back {
    background: none; border: none;
    color: var(--afo-gray);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-weight: 600;
}
.afo-btn-back:hover { color: #374151; }

/* Loader spinner inside button */
.afo-btn-loader {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: afo-spin .7s linear infinite;
}
@keyframes afo-spin { to { transform: rotate(360deg); } }

/* ── SUCCESS ── */
.afo-screen-success {
    text-align: center;
    padding: 40px 24px;
}
.afo-success-icon { margin-bottom: 20px; }
.afo-screen-success h2 { font-size: 26px; font-weight: 800; color: var(--afo-navy); margin: 0 0 12px; }
.afo-screen-success p  { font-size: 15px; color: var(--afo-gray); max-width: 480px; margin: 0 auto; line-height: 1.7; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .afo-auth-title   { font-size: 21px; }
    .afo-field-row    { grid-template-columns: 1fr; }
    .afo-field-row-3  { grid-template-columns: 1fr; }
    .afo-radio-cards  { grid-template-columns: 1fr; }
    .afo-recap        { grid-template-columns: 1fr; }
    .afo-payment-cards { flex-direction: column; }
    .afo-pay-card { width: 100%; }
    .afo-screen-header h2 { font-size: 19px; }
    .afo-btn-cta  { width: 100%; justify-content: center; }
}
