.auth-proof-box { border: 1px dashed #cbd5e1; border-radius: var(--radius-md); padding: 12px; background: #f8fafc; }
.auth-proof-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth-proof-preview { display: none; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.auth-proof-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: #fff; }
.auth-proof-meta { flex: 1; font-size: 0.8rem; color: var(--text-main); word-break: break-word; }


.auth-overlay {
    --auth-ink: #172950;
    --auth-blue: #214dc5;
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    overflow: auto;
    padding: clamp(16px, 4vw, 64px);
    background: radial-gradient(ellipse at 20% 20%, #e5edfb, transparent 60%), #f1f4fa;
    color: var(--auth-ink);
}
.auth-overlay.show { display: flex; }
.auth-card {
    display: grid;
    grid-template-columns: .94fr 1.06fr;
    margin: auto;
    width: min(100%, 1040px);
    flex: none;
    padding: 10px;
    border: 1px solid #d9e1ed;
    border-radius: 26px;
    background: white;
    box-shadow: 0 24px 70px -32px #263f7355;
    animation: auth-arrive .48s ease-out both;
}
.auth-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 550px;
    border-radius: 18px;
    background-color: #dbe7fd;
    background-image: linear-gradient(#7895c325 1px, transparent 1px), linear-gradient(90deg, #7895c325 1px, transparent 1px), radial-gradient(ellipse at 0 0, #edf4ff, transparent 85%);
    background-size: 24px 24px, 24px 24px, 100% 100%;
}
.auth-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; padding: 28px; }
.auth-brand img { object-fit: contain; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 1.18rem; letter-spacing: -.04em; }
.auth-brand span { color: #44577a; font-size: .81rem; }
.auth-art { position: absolute; top: 53%; left: 50%; width: 270px; height: 300px; transform: translate(-50%, -50%); }
.auth-notebook {
    position: absolute;
    left: 18px;
    top: 15px;
    width: 205px;
    height: 258px;
    padding: 47px 0 0 35px;
    border-radius: 4px 15px 15px 4px;
    color: #fff8e7;
    background: linear-gradient(90deg, #183773 0%, #254a92 5%, #142f70 6%, #426acd 9%, #355dc4 48%, #284faa);
    box-shadow: 1px 2px #192f63, 2px 4px #f7f4df, 2px 5px #bbbdba, 3px 7px #fff9e4, 3px 9px #224486, 9px 24px 22px -9px #415d9366;
    transform: rotate(-12deg);
    animation: auth-book-settle 1.15s cubic-bezier(.2,.8,.2,1) both;
}
.auth-notebook::before {
    content: ''; position: absolute; inset: 0 16px 0 auto; width: 9px;
    background: repeating-linear-gradient(0deg, #172f67 0 1px, #253e7b 1px 3px);
    box-shadow: 2px 0 3px #112c6b55;
}
.auth-notebook::after {
    content: ''; position: absolute; right: 42px; top: 102%; width: 18px; height: 25px;
    background: #ed9c42; clip-path: polygon(0 0,100% 0,100% 100%,50% 74%,0 100%);
}
.auth-book-title { font-family: Georgia, serif; font-size: 3rem; line-height: .98; letter-spacing: -.06em; }
.auth-book-lines { display: block; width: 72px; height: 8px; margin-top: 28px; border-block: 1px solid #dfe9ffad; }
.auth-pencil {
    position: absolute; bottom: 0; right: 12px; width: 12px; height: 169px; border-radius: 3px;
    transform: rotate(27deg); background: linear-gradient(to bottom, #d99089 0 8%, #bcc7d5 8% 14%, transparent 14%), linear-gradient(90deg, #c47722 0 23%, #ffd077 23% 65%, #eea33b 65%);
    box-shadow: 4px 6px 7px #465d7535;
}
.auth-pencil::after {
    content: ''; position: absolute; top: 99%; width: 100%; height: 18px;
    clip-path: polygon(0 0,100% 0,50% 100%); background: linear-gradient(#e8bf8d 68%, #293449 68%);
}
.auth-content { min-width: 0; align-self: center; padding: clamp(22px, 4vw, 48px); }
.auth-tabs { display: flex; position: relative; border-bottom: 2px solid #e2e7ef; }
.auth-tabs::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 50%; height: 3px;
    border-radius: 3px; background: var(--auth-blue); transition: transform .27s cubic-bezier(.2,.8,.2,1);
}
.auth-tabs:has(#tabBtnRegister.active)::after { transform: translateX(100%); }
.auth-tab-btn {
    flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 4px;
    font-family: inherit; font-size: .9rem; font-weight: 600;
    border: 0; background: transparent; color: #596780; cursor: pointer;
}
.auth-tab-btn.active, .auth-link-btn { color: var(--auth-blue); }
.auth-body { position: relative; isolation: isolate; }
.auth-body > [role="tabpanel"]:not([hidden]) { display: flow-root; isolation: isolate; }
.auth-page-roll { display: none; }
.auth-body[data-turn] {
    overflow: hidden;
    --page-duration: 920ms;
    --page-ease: cubic-bezier(.42, .03, .22, 1);
}
.auth-body[data-turn] .auth-leaving {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: white;
    pointer-events: none;
    animation: auth-peel-forward var(--page-duration) var(--page-ease) both;
}
.auth-body[data-turn="back"] .auth-leaving { animation-name: auth-peel-back; }
.auth-body[data-turn] .auth-page-roll {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.auth-body[data-turn="back"] .auth-page-roll { transform: scaleX(-1); }
.auth-page-roll span {
    position: absolute;
    inset: 0;
    animation: auth-roll-across var(--page-duration) var(--page-ease) both;
}
/* The shaded underside follows the diagonal cut in the outgoing sheet. */
.auth-page-roll span::before,
.auth-page-roll span::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 29%;
    clip-path: polygon(0 0, 75% 0, 100% 100%, 25% 100%);
}
.auth-page-roll span::before {
    margin-left: 5%;
    background: linear-gradient(90deg, #2a365c66, transparent 82%);
}
.auth-page-roll span::after {
    background:
        linear-gradient(90deg, #697895, #c3ccda 13%, #fffdf2 39%, #fffdf2aa 50%, #c7cdd9aa 70%, #8b97aa),
        repeating-linear-gradient(0deg, #fffcf2 0 22px, #abbad2 22px 23px);
    border-radius: 0 32% 12% 0 / 0 3% 2% 0;
}
@keyframes auth-roll-across {
    from { transform: translateX(101%); }
    to { transform: translateX(-36%); }
}
@keyframes auth-peel-forward {
    from { clip-path: polygon(0 0, 101% 0, 108.25% 100%, 0 100%); }
    to { clip-path: polygon(0 0, -36% 0, -28.75% 100%, 0 100%); }
}
@keyframes auth-peel-back {
    from { clip-path: polygon(-1% 0, 100% 0, 100% 100%, -8.25% 100%); }
    to { clip-path: polygon(136% 0, 100% 0, 100% 100%, 128.75% 100%); }
}
.auth-heading { margin: 28px 0 4px; font-size: clamp(1.65rem, 3vw, 2.15rem); line-height: 1.15; letter-spacing: -.055em; color: var(--auth-ink); }
.auth-intro { margin: 0 0 26px; color: #52617a; font-size: 1rem; }
.auth-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-field { min-width: 0; margin-bottom: 16px; }
.auth-field > label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.auth-field .form-control { height: 46px; font-size: 1rem; border-radius: 9px; border-color: #c7d2e2; padding-left: 38px; }
.auth-field .form-control:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px #214dc51a; }
.auth-field .password-field-container input { padding-right: 45px; }
.password-toggle-btn {
    position: absolute; right: 2px; width: 42px; height: 42px; border: 0; border-radius: 7px;
    color: #576784; background: transparent; cursor: pointer;
}
.password-toggle-btn i { position: static; color: inherit; }
.auth-submit-btn {
    width: 100%; justify-content: center; min-height: 47px; margin-top: 4px;
    background: var(--auth-blue); font: inherit; font-weight: 600; border-radius: 9px;
    box-shadow: 0 5px 12px -5px #214dc580;
}
.auth-submit-btn:active { transform: translateY(1px); }
.auth-switch-note { margin: 18px 0 0; text-align: center; color: #52617a; font-size: .875rem; }
.auth-link-btn { background: none; border: 0; font: inherit; font-weight: 600; padding: 0; cursor: pointer; }
.auth-link-btn:hover { text-decoration: underline; }
.auth-hint { color: #52617a; margin-top: 6px; font-size: .81rem; }
.auth-card button:focus-visible { outline: 3px solid var(--auth-blue); outline-offset: 2px; }
@keyframes auth-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-book-settle { from { transform: translateY(18px) rotate(-17deg); } to { transform: rotate(-12deg); } }
@media (max-width: 760px) {
    .auth-overlay { padding: 12px; }
    .auth-card { grid-template-columns: 1fr; max-width: 540px; padding: 7px; border-radius: 19px; }
    .auth-visual { min-height: 82px; border-radius: 12px; display: flex; align-items: center; }
    .auth-brand { padding: 15px; }
    .auth-art { left: auto; right: -70px; top: 95%; transform: translateY(-50%) scale(.41); }
    .auth-content { padding: 12px clamp(12px, 4vw, 26px) 24px; }
    .auth-heading { margin-top: 23px; }
}
@media (max-width: 560px) {
    .auth-grid-2 { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-card, .auth-card *, .auth-card *::after { animation: none; transition: none; }
    .auth-submit-btn:hover, .auth-submit-btn:active { transform: none; }
}
