/* ==========================================================================
   TeacherTo — Auth (OTP / password / register)
   ========================================================================== */

.tt-auth {
    position: relative;
    padding-block: clamp(1.5rem, 5vw, 3.5rem);
}
.tt-auth__shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 980px;
    margin-inline: auto;
    border-radius: var(--tt-r-lg);
    overflow: hidden;
    background: var(--tt-surface);
    border: 1.5px solid var(--tt-line);
    box-shadow: var(--tt-sh-lg);
}

/* Aside (illustration) */
.tt-auth__aside {
    position: relative;
    padding: 1.5rem;
    background:
        radial-gradient(90% 90% at 100% 0%, rgba(255, 183, 3, .34), transparent 55%),
        radial-gradient(80% 80% at 0% 100%, rgba(0, 168, 232, .3), transparent 55%),
        linear-gradient(150deg, #a51f37, #7b001f 60%, #55001a);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    overflow: hidden;
    order: 2;
}
.tt-auth__aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: .5;
}
.tt-auth__aside > * { position: relative; z-index: 1; }
.tt-auth__aside h2 { color: #fff; font-size: clamp(1.1rem, 3vw, 1.5rem); margin: 0; line-height: 1.6; }
.tt-auth__aside p { margin: 0; font-size: .78rem; line-height: 2; color: rgba(255, 255, 255, .82); }
.tt-auth__mascot {
    font-size: clamp(3rem, 12vw, 4.5rem);
    line-height: 1;
    align-self: center;
    animation: tt-bob 5s ease-in-out infinite;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .35));
    margin-block: .5rem;
}
.tt-auth__perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.tt-auth__perks li { display: flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 700; }
.tt-auth__perks .material-symbols-outlined {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .16);
    font-size: .95rem;
    color: #ffd75e;
    flex: 0 0 auto;
}

/* Form side */
.tt-auth__main { padding: clamp(1.25rem, 4vw, 2.25rem); order: 1; }
.tt-auth__brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.tt-auth__title { margin: 0 0 .25rem; font-size: clamp(1.15rem, 3.6vw, 1.5rem); }
.tt-auth__sub { margin: 0 0 1.25rem; font-size: .76rem; color: var(--tt-text-3); line-height: 1.9; }

/* Tabs */
.tt-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem;
    padding: .28rem;
    border-radius: var(--tt-r-full);
    background: var(--tt-surface-3);
    margin-bottom: 1.1rem;
}
.tt-tabs__btn {
    border: 0;
    background: transparent;
    padding: .6rem .5rem;
    border-radius: var(--tt-r-full);
    font-size: .76rem;
    font-weight: 800;
    color: var(--tt-text-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    transition: all var(--tt-t) var(--tt-ease-bounce);
}
.tt-tabs__btn .material-symbols-outlined { font-size: 1rem; }
.tt-tabs__btn.is-active {
    background: var(--tt-surface);
    color: var(--tt-primary);
    box-shadow: var(--tt-sh-sm);
}

.tt-auth__panel { display: none; flex-direction: column; gap: .9rem; }
.tt-auth__panel.is-active { display: flex; animation: tt-fade-up .35s var(--tt-ease-soft); }

/* Phone input */
.tt-phone { position: relative; display: flex; align-items: center; }
.tt-phone__prefix {
    position: absolute;
    inset-inline-start: .4rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .55rem;
    border-radius: var(--tt-r-full);
    background: var(--tt-surface-3);
    font-size: .72rem;
    font-weight: 800;
    color: var(--tt-text-2);
    pointer-events: none;
    direction: ltr;
}
.tt-phone input,
.tt-field .tt-phone input[type="tel"],
.tt-field .tt-phone input[type="text"] {
    width: 100%;
    min-height: 52px;
    padding-inline: 4.9rem 1rem;
    border-radius: var(--tt-r-full);
    border: 1.5px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-text);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .08em;
    direction: ltr;
    text-align: start;
}
.tt-phone input:focus { outline: none; border-color: var(--tt-azure); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tt-azure) 16%, transparent); }

/* OTP boxes */
.tt-otp {
    display: flex;
    gap: .4rem;
    justify-content: center;
    direction: ltr;
}
.tt-otp input {
    width: 100%;
    max-width: 52px;
    aspect-ratio: 1 / 1.1;
    border-radius: var(--tt-r-sm);
    border: 1.5px solid var(--tt-line);
    background: var(--tt-surface);
    color: var(--tt-text);
    font-size: 1.25rem;
    font-weight: 900;
    text-align: center;
    transition: all var(--tt-t-fast);
    padding: 0;
}
.tt-otp input:focus {
    outline: none;
    border-color: var(--tt-azure);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tt-azure) 16%, transparent);
    transform: translateY(-2px);
}
.tt-otp input.is-filled { border-color: color-mix(in srgb, var(--tt-mint) 60%, transparent); background: color-mix(in srgb, var(--tt-mint) 8%, var(--tt-surface)); }

.tt-auth__hint { font-size: .68rem; color: var(--tt-text-3); margin: 0; display: flex; align-items: center; gap: .3rem; }
.tt-auth__hint .material-symbols-outlined { font-size: .9rem; }

/* Shown only when "مدرس" is picked in the signup form. */
.tt-auth__note {
    align-items: flex-start;
    gap: .45rem;
    margin: .1rem 0 .3rem;
    padding: .55rem .7rem;
    border-radius: var(--tt-r-sm);
    background: color-mix(in srgb, var(--tt-gold) 16%, var(--tt-surface));
    border: 1px solid color-mix(in srgb, var(--tt-gold) 34%, transparent);
    color: var(--tt-text-2);
    font-size: .68rem;
    line-height: 1.85;
}
.tt-auth__note[hidden] { display: none; }
.tt-auth__note .material-symbols-outlined { flex: 0 0 auto; margin-top: .15rem; color: var(--tt-gold-deep); font-size: 1rem; }
.tt-auth__resend {
    border: 0;
    background: transparent;
    color: var(--tt-primary);
    font-size: .72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem;
    flex: 0 0 auto;
    line-height: 1.7;
    white-space: nowrap;
}
.tt-auth__resend[disabled] { color: var(--tt-text-3); pointer-events: none; }
/* Keep the countdown on one line; if the row still runs out of room the
   second action wraps to its own line instead of squeezing the text. */
.tt-auth__panel .tt-between { flex-wrap: wrap; gap: .35rem .75rem; }
.tt-auth__resend-text { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tt-auth__resend .material-symbols-outlined { font-size: 1rem; }

.tt-auth__divider {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .64rem;
    color: var(--tt-text-3);
    font-weight: 700;
    margin-block: .2rem;
}
.tt-auth__divider::before, .tt-auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--tt-line);
}

.tt-auth__switch { font-size: .72rem; color: var(--tt-text-3); text-align: center; margin: 0; }
.tt-auth__switch a, .tt-auth__switch button {
    color: var(--tt-primary);
    font-weight: 800;
    border: 0;
    background: none;
    padding: 0;
    font-size: inherit;
}

/* Role picker */
.tt-roles { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tt-role {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .7rem .4rem;
    border-radius: var(--tt-r);
    border: 1.5px solid var(--tt-line);
    background: var(--tt-surface);
    font-size: .7rem;
    font-weight: 800;
    color: var(--tt-text-2);
    cursor: pointer;
    transition: all var(--tt-t-fast);
    text-align: center;
}
.tt-role input { position: absolute; opacity: 0; }
.tt-role .material-symbols-outlined { font-size: 1.3rem; color: var(--tt-text-3); }
.tt-role.is-active { border-color: var(--tt-primary); background: color-mix(in srgb, var(--tt-primary) 7%, var(--tt-surface)); color: var(--tt-primary); box-shadow: 0 8px 18px -10px rgba(158, 27, 50, .5); }
.tt-role.is-active .material-symbols-outlined { color: var(--tt-primary); }

/* Alert */
.tt-alert {
    display: flex;
    gap: .5rem;
    padding: .7rem .85rem;
    border-radius: var(--tt-r);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.9;
    background: color-mix(in srgb, var(--tt-azure) 12%, var(--tt-surface));
    color: var(--tt-text-2);
    border: 1px solid color-mix(in srgb, var(--tt-azure) 26%, transparent);
}
.tt-alert .material-symbols-outlined { font-size: 1.05rem; color: var(--tt-azure); flex: 0 0 auto; }
.tt-alert--error { background: color-mix(in srgb, #e63946 10%, var(--tt-surface)); border-color: color-mix(in srgb, #e63946 30%, transparent); }
.tt-alert--error .material-symbols-outlined { color: #e63946; }
.tt-alert--success { background: color-mix(in srgb, var(--tt-mint) 12%, var(--tt-surface)); border-color: color-mix(in srgb, var(--tt-mint) 30%, transparent); }
.tt-alert--success .material-symbols-outlined { color: var(--tt-mint); }
.tt-alert[hidden] { display: none; }

/* Step indicator */
.tt-steps { display: flex; align-items: center; gap: .35rem; margin-bottom: .25rem; }
.tt-steps__dot {
    height: 5px;
    flex: 1;
    border-radius: 99px;
    background: var(--tt-surface-3);
    transition: background var(--tt-t);
}
.tt-steps__dot.is-done { background: linear-gradient(90deg, var(--tt-gold), var(--tt-primary)); }

/* Auth modal */
.tt-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 1rem;
    pointer-events: none;
}
.tt-modal__scrim {
    position: absolute;
    inset: 0;
    background: rgba(20, 8, 12, .6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--tt-t);
}
.tt-modal__box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--tt-surface);
    border-radius: var(--tt-r-lg);
    border: 1.5px solid var(--tt-glass-line);
    box-shadow: var(--tt-sh-lg);
    padding: 1.35rem;
    transform: translateY(20px) scale(.96);
    opacity: 0;
    transition: all var(--tt-t) var(--tt-ease-bounce);
}
.tt-modal.is-open { pointer-events: auto; }
.tt-modal.is-open .tt-modal__scrim { opacity: 1; }
.tt-modal.is-open .tt-modal__box { transform: translateY(0) scale(1); opacity: 1; }
.tt-modal__close {
    position: absolute;
    top: .6rem;
    inset-inline-end: .6rem;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 0;
    background: var(--tt-surface-3);
    color: var(--tt-text-2);
    display: grid; place-items: center;
    z-index: 2;
}
.tt-modal__close:hover { background: var(--tt-primary); color: #fff; }

@media (min-width: 860px) {
    .tt-auth__shell { grid-template-columns: 1.05fr .95fr; }
    .tt-auth__aside { order: 1; padding: 2.25rem 1.75rem; }
    .tt-auth__main { order: 2; padding: 2.5rem; }
}
