/* ==========================================================================
   Palangi Academy — Auth (Login / Register) theme
   Reuses the site's existing color tokens (defined in style.css :root):
   --navy #183a78, --blue #2d4f95, --blue-deep #263f83, --light-blue #76a2ef,
   --orange #f36c21, --ink #082b65, --border #d8dce4, --text-dark #252525
   ========================================================================== */

.auth-shell {
    background: #f3f5fa;
    padding: 48px 16px 64px;
    min-height: 70vh;
}

.auth-shell__inner {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    border-radius: 26px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 60px -20px rgba(8, 31, 74, 0.28), 0 4px 18px rgba(8, 31, 74, 0.08);
    animation: authRise 0.6s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------- Aside (brand panel) ---------------- */

.auth-aside {
    position: relative;
    overflow: hidden;
    padding: 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(150deg, var(--navy) 0%, var(--blue) 58%, var(--blue-deep) 100%);
    isolation: isolate;
}

.auth-aside::before,
.auth-aside::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: .55;
    z-index: -1;
}

.auth-aside::before {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, var(--orange) 0%, rgba(243, 108, 33, 0) 70%);
    top: -90px;
    inset-inline-end: -80px;
    animation: authBlobFloat 9s ease-in-out infinite;
}

.auth-aside::after {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--purple) 0%, rgba(189, 53, 201, 0) 70%);
    bottom: -140px;
    inset-inline-start: -100px;
    animation: authBlobFloat 11s ease-in-out infinite reverse;
}

@keyframes authBlobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-16px, 18px) scale(1.08); }
}

.auth-aside__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.auth-aside__logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}

.auth-aside__logo span {
    font-family: IRANYekanWebBold;
    font-size: 18px;
}

.auth-aside__body {
    position: relative;
}

.auth-aside__title {
    font-family: IRANYekanWebExtraBold;
    font-size: 27px;
    line-height: 1.55;
    margin: 0 0 14px;
}

.auth-aside__subtitle {
    font-size: 14px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .82);
    margin: 0;
    max-width: 320px;
}

.auth-aside__floaticons {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.auth-aside__floaticons i {
    position: absolute;
    color: rgba(255, 255, 255, .16);
    animation: authIconFloat 6s ease-in-out infinite;
}

.auth-aside__floaticons i:nth-child(1) { font-size: 34px; top: 8%;  inset-inline-start: 6%;  animation-delay: 0s; }
.auth-aside__floaticons i:nth-child(2) { font-size: 24px; top: 34%; inset-inline-end: 8%;    animation-delay: 1.4s; }
.auth-aside__floaticons i:nth-child(3) { font-size: 20px; top: 62%; inset-inline-start: 12%; animation-delay: 2.6s; }

@keyframes authIconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-14px) rotate(6deg); }
}

.auth-aside__features {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-aside__features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, .92);
}

.auth-aside__features i {
    width: 32px;
    height: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    color: var(--orange);
    font-size: 14px;
}

/* ---------------- Form side ---------------- */

.auth-form-side {
    padding: 44px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--blue);
    background: #eef1fb;
    padding: 5px 12px;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 14px;
}

.auth-card__title {
    font-family: IRANYekanWebExtraBold;
    font-size: 22px;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.auth-card__subtitle {
    font-size: 13px;
    color: #8b93a7;
    margin: 0 0 26px;
    line-height: 1.8;
}

.auth-card__subtitle strong {
    color: var(--blue);
    font-family: IRANYekanWebMedium;
    unicode-bidi: plaintext;
}

/* ---------------- Step indicator ---------------- */

.auth-steps {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-step__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: IRANYekanWebBold;
    background: #eef1f8;
    color: #a4acc0;
    border: 2px solid #eef1f8;
    transition: all .35s ease;
    flex: none;
}

.auth-step__label {
    font-size: 12px;
    color: #a4acc0;
    transition: color .35s ease;
    white-space: nowrap;
}

.auth-step.is-active .auth-step__dot {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(45, 79, 149, .14);
}

.auth-step.is-active .auth-step__label {
    color: var(--blue);
    font-family: IRANYekanWebMedium;
}

.auth-step.is-done .auth-step__dot {
    background: #1f8a3e;
    border-color: #1f8a3e;
    color: #fff;
}

.auth-step.is-done .auth-step__label { color: #1f8a3e; }

.auth-steps__line {
    flex: 1;
    height: 2px;
    background: #eef1f8;
    margin: 0 6px;
    position: relative;
    min-width: 20px;
    border-radius: 2px;
    overflow: hidden;
}

.auth-steps__line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #1f8a3e;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .45s ease;
}

.auth-steps__line.is-filled::after { transform: scaleX(1); }

/* ---------------- Fields ---------------- */

.auth-field {
    position: relative;
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    font-size: 12.5px;
    color: #6b7386;
    margin-bottom: 7px;
}

.auth-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field__icon {
    position: absolute;
    inset-inline-start: 14px;
    color: #a4acc0;
    font-size: 14px;
    pointer-events: none;
    transition: color .25s ease;
}

.auth-field input,
.auth-field select,
.auth-field textarea {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
    padding-inline-start: 40px;
    padding-inline-end: 14px;
    font-size: 14px;
    color: var(--text-dark);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-field textarea { height: auto; padding-block: 12px; resize: vertical; }

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(45, 79, 149, .12);
}

.auth-field input:focus ~ .auth-field__icon,
.auth-field__control:focus-within .auth-field__icon {
    color: var(--blue);
}

.auth-field .field-toggle {
    position: absolute;
    inset-inline-end: 14px;
    background: none;
    border: 0;
    color: #a4acc0;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.auth-field.has-error input,
.auth-field.has-error select { border-color: #e02b2b; background: #fff6f6; }

.auth-field__error {
    display: block;
    color: #e02b2b;
    font-size: 12px;
    margin-top: 6px;
}

/* ---------------- Buttons ---------------- */

.auth-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 13px;
    font-family: IRANYekanWebMedium;
    font-size: 14.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .25s ease, filter .2s ease;
}

.auth-btn--primary {
    color: #fff;
    background: linear-gradient(95deg, var(--blue) 0%, var(--navy) 100%);
    box-shadow: 0 12px 24px -8px rgba(24, 58, 120, .55);
}

.auth-btn--primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.auth-btn--primary:active { transform: translateY(0); }

.auth-btn--primary[disabled] {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn--ghost {
    background: #f2f4f8;
    color: #6b7386;
    height: 44px;
    font-size: 13px;
}

.auth-btn--ghost:hover { background: #e8ebf3; }
.auth-btn--ghost[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- Account type cards (register step 3) ---------------- */

.account-type-selector { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.account-type-card {
    flex: 1; min-width: 130px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px 10px; border: 2px solid var(--border); border-radius: 14px;
    background: #fff; cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s, transform .2s;
}
.account-type-card:hover { border-color: var(--light-blue); transform: translateY(-2px); }
.account-type-card.is-active {
    border-color: var(--blue); background: #f0f4ff;
    box-shadow: 0 10px 20px -8px rgba(54, 89, 161, .35);
}
.account-type-card__icon {
    width: 44px; height: 44px; border-radius: 50%; background: #eef1f8;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
    color: var(--blue); transition: .2s;
}
.account-type-card.is-active .account-type-card__icon { background: var(--blue); color: #fff; }
.account-type-card__label { font-family: IRANYekanWebMedium; font-size: 13.5px; color: var(--text-dark); }
.account-type-card__desc { font-size: 11.5px; color: #8b93a7; }

/* ---------------- OTP boxes ---------------- */

.otp-head {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f6f8fd;
    border: 1px solid #e7ebf5;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 22px;
}

.otp-head i {
    width: 38px; height: 38px; flex: none; border-radius: 10px;
    background: #eaf1ff; color: var(--blue);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}

.otp-head span { font-size: 12.5px; color: #6b7386; line-height: 1.8; }
.otp-head strong { color: var(--navy); unicode-bidi: plaintext; }

.otp-boxes {
    display: flex;
    direction: ltr;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.otp-box {
    width: 52px;
    height: 58px;
    text-align: center;
    font-size: 22px;
    font-family: IRANYekanWebBold;
    color: var(--navy);
    border: 2px solid var(--border);
    border-radius: 13px;
    background: #fbfcfe;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.otp-box:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(45, 79, 149, .14);
    transform: translateY(-2px);
}

.otp-box.is-filled { border-color: var(--light-blue); background: #fff; }

.otp-boxes.is-success .otp-box {
    border-color: #1f8a3e;
    background: #f0fbf3;
    color: #1f8a3e;
}

.otp-boxes.is-error .otp-box {
    border-color: #e02b2b;
    background: #fff6f6;
    animation: otpShake .45s ease;
}

@keyframes otpShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.otp-error-text {
    text-align: center;
    color: #e02b2b;
    font-size: 12.5px;
    margin: 8px 0 0;
    min-height: 18px;
}

.otp-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 12.5px;
    color: #8b93a7;
}

.otp-resend-btn {
    background: none;
    border: 0;
    color: var(--blue);
    font-family: IRANYekanWebMedium;
    cursor: pointer;
    padding: 2px 4px;
}

.otp-resend-btn:disabled { color: #a4acc0; cursor: not-allowed; }
.otp-resend-btn .otp-timer { unicode-bidi: plaintext; }

/* ---------------- Success overlay ---------------- */

.otp-success-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, .97);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}

.otp-success-overlay.is-active {
    opacity: 1;
    pointer-events: all;
}

.otp-success-check { width: 84px; height: 84px; }

.otp-success-check circle {
    fill: none;
    stroke: #1f8a3e;
    stroke-width: 3;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    transform-origin: center;
}

.otp-success-check path {
    fill: none;
    stroke: #1f8a3e;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}

.otp-success-overlay.is-active .otp-success-check circle {
    animation: otpCircleDraw .5s ease forwards;
}

.otp-success-overlay.is-active .otp-success-check path {
    animation: otpCheckDraw .35s ease .45s forwards;
}

@keyframes otpCircleDraw { to { stroke-dashoffset: 0; } }
@keyframes otpCheckDraw { to { stroke-dashoffset: 0; } }

.otp-success-overlay .otp-success-ring {
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 3px solid rgba(31, 138, 62, .35);
    opacity: 0;
}

.otp-success-overlay.is-active .otp-success-ring {
    animation: otpRingPulse 1s ease .5s;
}

@keyframes otpRingPulse {
    0%   { opacity: .8; transform: scale(.8); }
    100% { opacity: 0; transform: scale(1.7); }
}

.otp-success-text {
    font-family: IRANYekanWebMedium;
    color: #1f8a3e;
    font-size: 15px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease .5s, transform .35s ease .5s;
}

.otp-success-overlay.is-active .otp-success-text {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------- Misc ---------------- */

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: #8b93a7;
}

.auth-switch a { color: var(--blue); font-family: IRANYekanWebMedium; }

.auth-card .alert { border-radius: 12px; font-size: 13px; }

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #8b93a7;
    margin-bottom: 18px;
}

.auth-back-link:hover { color: var(--blue); }

/* ---------------- Responsive ---------------- */

@media (max-width: 991px) {
    .auth-shell__inner { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-form-side { padding: 34px 22px; }
}

@media (max-width: 420px) {
    .otp-box { width: 44px; height: 52px; font-size: 19px; }
    .otp-boxes { gap: 7px; }
}
