/* ─── Forms & page headers (app + steps) ─── */

.page-header {
    text-align: center;
    margin-bottom: 22px;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.18);
    color: var(--gold-light);
}

.page-header-icon .icon { width: 26px; height: 26px; }

.page-header h1 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.page-header .subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 0;
}

.page-header .subtitle strong {
    color: var(--gold-light);
    font-weight: 700;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-field,
.form-group {
    text-align: right;
    margin-bottom: 14px;
}

.form-label,
.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-label .icon,
.form-group label .icon { width: 16px; height: 16px; color: var(--gold); }

.form-label .req { color: var(--gold); margin-right: 3px; }

.form-control,
.form-input,
.step-field-card input:not([type="file"]),
.step-field-card select {
    width: 100%;
    padding: 12px 14px;
    min-height: 46px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.94rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-control:focus,
.form-input:focus,
.step-field-card input:focus,
.step-field-card select:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: none;
}

.form-control::placeholder,
.form-input::placeholder,
.step-field-card input::placeholder {
    color: var(--muted-2);
}

.form-control:disabled,
.form-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-input.ltr { direction: ltr; text-align: center; }

.input-en-num {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
    unicode-bidi: plaintext;
}

.input-bale-id {
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.input-persian {
    direction: rtl;
    text-align: right;
    font-family: var(--font);
}

.dir-ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.form-alert,
.form-error {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.65;
}

.form-error,
.form-alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.form-alert--warn {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.form-alert--info {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--border);
    color: var(--gold-light);
}

.form-alert--success {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.22);
    color: #86efac;
}

.form-error { margin-top: 16px; }

.dev-hint {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border);
    color: var(--gold-light);
    font-size: 0.85rem;
    text-align: center;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    transition: color var(--transition);
}

.form-link:hover { color: var(--gold-light); }

.form-link .icon { width: 14px; height: 14px; }

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.form-actions .btn { width: 100%; }

@media (min-width: 520px) {
    .form-actions {
        flex-direction: row;
        align-items: stretch;
    }

    .form-actions .btn {
        width: auto;
        flex: 1;
    }
}

.otp-box,
.code-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr;
    margin-bottom: 24px;
}

.otp-digit,
.code-input {
    width: 56px;
    height: 60px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold-light);
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.otp-digit:focus,
.code-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: none;
    transform: none;
}

.input-otp-digit { text-align: center; }

@media (max-width: 400px) {
    .otp-digit,
    .code-input {
        width: 48px;
        height: 54px;
        font-size: 1.2rem;
    }
}

/* ─── Step navigation buttons (global — modal, forms, payment) ─── */
.btn-prev,
.step-btn--prev,
a.btn-prev,
.btn-next,
.step-btn--next,
button.btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    min-height: 46px;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.btn-prev,
.step-btn--prev,
a.btn-prev {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-prev:hover,
.step-btn--prev:hover,
a.btn-prev:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.btn-next,
.step-btn--next,
button.btn-next {
    min-width: 140px;
    background: var(--gold-gradient);
    color: #0a0a0a;
    border: none;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.18);
}

.btn-next:hover:not(:disabled),
.step-btn--next:hover:not(:disabled) {
    transform: none;
    filter: brightness(1.05);
}

.btn-next:disabled,
.step-btn--next:disabled {
    background: #3a3a3a;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.85;
}

.btn-prev .icon,
.btn-next .icon,
.step-btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-next--full { width: 100%; }

.btn.is-loading,
.btn-next.is-loading,
.btn-prev.is-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}
