/* ══════════════════════════════════════════════════════════════
   phone_otp_login — otp_login.css
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Page background ──────────────────────────────────────── */
.otp_body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0d1b2a 0%, #1b2a3b 50%, #16354f 100%);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    direction: rtl;
}

/* ── Wrapper & Card ───────────────────────────────────────── */
.otp_wrapper {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.otp_card {
    background: #fff;
    border-radius: 20px;
    padding: 2.25rem 2rem 2rem;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
    animation: card_in .35s ease;
}

@keyframes card_in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ─────────────────────────────────────────────────── */
.otp_logo_wrap { text-align: center; margin-bottom: 1.25rem; }
.otp_logo      { max-height: 56px; max-width: 180px; object-fit: contain; }

/* ── Titles ───────────────────────────────────────────────── */
.otp_title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin-bottom: .2rem;
}
.otp_subtitle {
    font-size: .88rem;
    color: #718096;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── Step header (back + title) ───────────────────────────── */
.otp_step_header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1rem;
}
.otp_step_header .otp_title,
.otp_step_header .otp_subtitle { text-align: right; margin-bottom: .1rem; }
.otp_step_header > div { flex: 1; }

.otp_back_btn {
    background: #f0f4ff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    color: #4c51bf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: .25rem;
    transition: background .15s;
}
.otp_back_btn:hover { background: #dde4ff; }

/* ── Phone badge (reg form) ───────────────────────────────── */
.otp_phone_badge_wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f7fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .55rem .85rem;
    margin-bottom: 1.1rem;
}
.otp_phone_badge {
    flex: 1;
    font-size: .95rem;
    font-weight: 600;
    color: #2d3748;
    direction: ltr;
    text-align: right;
}
.otp_btn_link_sm {
    background: none;
    border: none;
    color: #4c51bf;
    font-size: .82rem;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

/* ── Fields ───────────────────────────────────────────────── */
.otp_field_wrap { margin-bottom: 1rem; }

.otp_label {
    display: block;
    font-size: .83rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: .38rem;
}

.otp_phone_row { display: flex; gap: .5rem; align-items: center; }

.otp_prefix {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .6rem .7rem;
    font-size: .9rem;
    background: #f7fafc;
    color: #2d3748;
    white-space: nowrap;
    direction: ltr;
    font-weight: 600;
}

.otp_select {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .6rem .5rem;
    font-size: .88rem;
    background: #f7fafc;
    color: #2d3748;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}
.otp_select:focus { border-color: #4c51bf; }

.otp_input {
    flex: 1 1 auto;
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .65rem .9rem;
    font-size: .97rem;
    color: #2d3748;
    background: #f7fafc;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    text-align: right;
}
.otp_input:focus {
    border-color: #4c51bf;
    box-shadow: 0 0 0 3px rgba(76,81,191,.13);
    background: #fff;
}

/* OTP code — large centred digits */
.otp_code_input {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .45em;
    text-align: center;
    direction: ltr;
    padding: .7rem;
}

/* ── Gender buttons ───────────────────────────────────────── */
.otp_gender_row { display: flex; gap: .75rem; }

.otp_gender_btn {
    flex: 1;
    padding: .7rem .5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f7fafc;
    color: #4a5568;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.otp_gender_btn:hover   { border-color: #4c51bf; color: #4c51bf; }
.otp_gender_btn.selected {
    border-color: #4c51bf;
    background: #eef0ff;
    color: #4c51bf;
    transform: scale(1.02);
}

/* ── Date of birth ────────────────────────────────────────── */
.otp_dob_row { display: flex; gap: .5rem; }
.otp_dob_select { flex: 1; padding: .6rem .35rem; font-size: .86rem; }

/* ── Field-level error ────────────────────────────────────── */
.otp_field_error {
    font-size: .78rem;
    color: #c53030;
    margin-top: .3rem;
}

/* ── Alert boxes ──────────────────────────────────────────── */
.otp_alert {
    border-radius: 10px;
    padding: .65rem .9rem;
    font-size: .87rem;
    margin-bottom: .9rem;
}
.otp_alert_danger {
    background: #fff5f5;
    border: 1px solid #fc8181;
    color: #c53030;
}

/* ── Buttons ──────────────────────────────────────────────── */
.otp_btn {
    display: block;
    width: 100%;
    padding: .78rem 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s, opacity .2s;
    margin-bottom: .7rem;
    letter-spacing: .01em;
}
.otp_btn:active   { transform: scale(.98); }
.otp_btn:disabled { opacity: .6; cursor: not-allowed; }

.otp_btn_primary         { background: #4c51bf; color: #fff; }
.otp_btn_primary:hover   { background: #434190; }

.otp_btn_success         { background: #38a169; color: #fff; }
.otp_btn_success:hover   { background: #2f855a; }

.otp_btn_link {
    background: none;
    border: none;
    color: #4c51bf;
    font-size: .88rem;
    cursor: pointer;
    padding: .2rem 0;
    text-decoration: underline;
    display: inline-block;
}
.otp_btn_link:hover { color: #434190; }

.otp_btn_back {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: .35rem;
}

/* ── OTP sent notice ──────────────────────────────────────── */
.otp_sent_notice {
    font-size: .92rem;
    color: #4a5568;
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* ── Resend ───────────────────────────────────────────────── */
.otp_resend_wrap { text-align: center; margin: .3rem 0 .5rem; }
.otp_muted { font-size: .84rem; color: #a0aec0; }

/* ── Spinner ──────────────────────────────────────────────── */
.otp_spinner { display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .35; }
}

/* ── Step fade-in ─────────────────────────────────────────── */
#step_phone, #step_register, #step_otp {
    animation: fade_in .25s ease;
}
@keyframes fade_in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .otp_card { padding: 1.75rem 1.25rem; }
    .otp_title { font-size: 1.25rem; }
    .otp_code_input { font-size: 1.6rem; letter-spacing: .3em; }
}
