/* ====== Base (Fintech Pro: Black + Yellow) ====== */
:root {
    --bg: #0b0b0d;
    --card: #121216;
    --muted: #8f93a1;
    --text: #e9ecf1;
    --primary: #f1c40f;
    --primary-600: #d4ad0e;
    --success: #20c997;
    --danger: #ff5c5c;
    --border: #20222a;
    --focus: 0 0 0 3px rgba(241, 196, 15, 0.18);
    --tap-min: 48px;
}

/* Reset & base */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.screen {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 28px 14px;
}

.card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.03)), var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    margin: 12px;
}

/* Logo & title */
.logo {
    display: block;
    width: 84px;
    height: auto;
    opacity: .98;
    margin: 6px auto 10px;
    border-radius: 50%;
}

.title {
    margin: 6px 0 4px;
    text-align: center;
    font-weight: 700;
    font-size: 22px;
}

.subtitle {
    margin: 0 0 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* Controls */
.label {
    display: block;
    margin: 8px 0 8px;
    color: #cfd3dd;
    font-weight: 600;
    letter-spacing: .2px;
}

/* Phone row */
.phone-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.prefix {
    background: #161821;
    color: #cfd3dd;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 58px;
    text-align: center;
    font-weight: 700;
}

.phone-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: #0f1016;
    color: var(--text);
    border-radius: 10px;
    outline: none;
    min-height: var(--tap-min);
}

.phone-input::placeholder {
    color: #9aa0ad;
    opacity: 0.9;
}

.phone-input:focus {
    box-shadow: var(--focus);
    border-color: var(--primary);
}

/* Buttons */
.btn {
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    font-weight: 800;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .06s ease, background .16s ease, opacity .12s ease;
    touch-action: manipulation;
    min-height: var(--tap-min);
    font-size: 15px;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-600));
    color: #000;
    box-shadow: 0 6px 18px rgba(209, 169, 14, 0.08);
}

.btn-success {
    background: linear-gradient(180deg, var(--success), #14b886);
    color: #000;
}

/* hint */
.hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* OTP boxes */
.otp-info {
    color: #cfd3dd;
    margin: 0 0 10px;
    text-align: center;
    font-size: 13px;
}

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(48px, 1fr));
    gap: 10px;
    margin: 12px 0 6px;
}

.otp-input {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 12px 0;
    background: #0f1016;
    color: var(--text);
    border: 2px solid #2a2c36;
    border-radius: 10px;
    outline: none;
    transition: border .15s ease, box-shadow .12s ease;
    min-height: var(--tap-min);
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: var(--focus);
}

/* Resend / Change */
.resend-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 8px;
}

.link-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 8px 6px;
    font-size: 13px;
}

.link-btn[disabled] {
    color: #9a8f3e;
    cursor: not-allowed;
}

/* Toasts */
.toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: #000;
    font-weight: 700;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
    opacity: 1;
    transition: opacity .22s ease, transform .2s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

.toast.info {
    background: var(--primary);
    color: #000;
}

/* Focus visible for keyboard only */
:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Small screens */
@media (max-width: 420px) {
    .card {
        max-width: 92vw;
        padding: 18px;
    }

    .otp-boxes {
        grid-template-columns: repeat(6, minmax(40px, 1fr));
        gap: 8px;
    }

    .otp-input {
        font-size: 18px;
        padding: 10px 0;
    }

    .btn {
        padding: 12px 10px;
        font-size: 15px;
    }
}

/* Very small narrow phones */
@media (max-width: 340px) {
    .otp-boxes {
        grid-template-columns: repeat(3, minmax(42px, 1fr));
        row-gap: 10px;
    }

    .phone-row {
        gap: 6px;
    }

    .prefix {
        min-width: 52px;
        padding: 10px 10px;
    }
}

/* Larger displays */
@media (min-width: 900px) {
    .card {
        padding: 30px;
    }

    .title {
        font-size: 24px;
    }
}