:root {
    --auth-navy: #071d43;
    --auth-blue: #0868eb;
    --auth-blue-dark: #0746c8;
    --auth-cyan: #35b6f4;
    --auth-muted: #64738d;
    --auth-border: #dfe6f0;
    --auth-surface: #ffffff;
    --auth-bg: #f3f7ff;
    --auth-danger: #b62438;
    --auth-success: #16724b;
    --auth-warning: #8a5b00;
}

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

html {
    min-width: 320px;
    background: var(--auth-bg);
}

body.auth-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-navy);
    background:
        radial-gradient(circle at 17% 18%, rgba(58, 139, 255, .1), transparent 29rem),
        radial-gradient(circle at 88% 80%, rgba(36, 177, 246, .08), transparent 27rem),
        linear-gradient(135deg, #f5f8ff 0%, #eef4ff 42%, #f9fbff 100%);
    font-family: 'DM Sans', sans-serif;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 64px) clamp(18px, 5vw, 80px) 22px;
}

.auth-shell::before,
.auth-shell::after {
    position: fixed;
    z-index: -1;
    content: '';
    pointer-events: none;
}

.auth-shell::before {
    left: -8rem;
    bottom: -15rem;
    width: 38rem;
    height: 38rem;
    border: 2px solid rgba(22, 103, 225, .1);
    border-radius: 34% 66% 61% 39% / 40% 37% 63% 60%;
    transform: rotate(17deg);
}

.auth-shell::after {
    right: -12rem;
    top: -18rem;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.84), rgba(255,255,255,0) 69%);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(310px, .82fr) minmax(440px, 1fr);
    align-items: center;
    width: min(100%, 1260px);
    margin: auto;
    gap: clamp(42px, 7vw, 110px);
}

.auth-institution {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 20px 0;
}

.seplan-lockup {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.seplan-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 7px;
    width: 88px;
    height: 92px;
}

.seplan-mark span {
    flex: 1;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #1279ee, #0747c9);
    box-shadow: 0 8px 18px rgba(9, 91, 213, .18);
}

.seplan-mark span:nth-child(1) { height: 62%; }
.seplan-mark span:nth-child(2) { height: 84%; background: linear-gradient(180deg, #0846c8, #062d9d); }
.seplan-mark span:nth-child(3) { height: 100%; background: linear-gradient(180deg, #4ec2f7, #0d74e7); }

.seplan-copy strong,
.seplan-copy small {
    display: block;
}

.seplan-copy strong {
    color: #082754;
    font: 700 clamp(2.25rem, 4.3vw, 3.65rem)/1 'Sora', sans-serif;
    letter-spacing: .02em;
}

.seplan-copy small {
    max-width: 265px;
    margin-top: 11px;
    color: #526988;
    font: 500 clamp(.95rem, 1.7vw, 1.28rem)/1.45 'Sora', sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.institution-message {
    max-width: 470px;
    margin-top: clamp(50px, 8vh, 86px);
}

.institution-message h1 {
    margin: 0;
    color: #0b2751;
    font: 700 clamp(1.75rem, 3vw, 2.5rem)/1.28 'Sora', sans-serif;
    letter-spacing: -.035em;
}

.institution-message h1 em {
    color: var(--auth-blue);
    font-style: normal;
}

.institution-rule {
    display: block;
    width: 78px;
    height: 4px;
    margin: 28px 0 34px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--auth-blue), var(--auth-cyan));
}

.benefit-list {
    display: grid;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.benefit-item {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: start;
    gap: 16px;
}

.benefit-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(8, 104, 235, .18);
    border-radius: 13px;
    background: rgba(255, 255, 255, .7);
    color: var(--auth-blue);
    font-size: 1.3rem;
}

.benefit-item strong,
.benefit-item span {
    display: block;
}

.benefit-item strong {
    margin-bottom: 3px;
    color: #102a53;
    font: 700 .98rem/1.4 'Sora', sans-serif;
}

.benefit-item span {
    color: #687792;
    font-size: .91rem;
    line-height: 1.55;
}

/* Mantém cada glifo centralizado mesmo após a regra genérica dos textos. */
.benefit-item .benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    color: var(--auth-blue);
    line-height: 1;
}

.benefit-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.auth-card-wrap {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.auth-card {
    width: min(100%, 640px);
    padding: clamp(30px, 4.5vw, 54px);
    border: 1px solid rgba(220, 228, 239, .86);
    border-radius: 25px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 24px 65px rgba(29, 57, 103, .13), 0 3px 12px rgba(22, 51, 94, .05);
}

.auth-card.auth-card--register {
    width: min(100%, 730px);
    padding-top: clamp(27px, 3.5vw, 42px);
    padding-bottom: clamp(27px, 3.5vw, 42px);
}

.auth-card-header {
    margin-bottom: 28px;
    text-align: center;
}

.security-badge {
    display: inline-grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, #edf5ff, #e4eeff);
    color: var(--auth-blue);
    font-size: 2rem;
    box-shadow: inset 0 0 0 1px rgba(15, 104, 230, .06);
}

.auth-card--register .security-badge {
    width: 66px;
    height: 66px;
    margin-bottom: 16px;
    font-size: 1.7rem;
}

.auth-card-header h2 {
    margin: 0;
    color: #071d43;
    font: 700 clamp(1.7rem, 3vw, 2.35rem)/1.25 'Sora', sans-serif;
    letter-spacing: -.04em;
}

.auth-card-header p {
    max-width: 430px;
    margin: 12px auto 0;
    color: var(--auth-muted);
    font-size: 1rem;
    line-height: 1.55;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 22px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 12px;
    font-size: .88rem;
    line-height: 1.5;
}

.auth-alert i { flex: 0 0 auto; margin-top: 2px; }
.auth-alert--erro { border-color: #f3c6cc; background: #fff5f6; color: var(--auth-danger); }
.auth-alert--aviso { border-color: #f1dfb1; background: #fffaf0; color: var(--auth-warning); }
.auth-alert--sucesso { border-color: #bfe6d3; background: #f2fbf7; color: var(--auth-success); }

.auth-form {
    display: grid;
    gap: 19px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.auth-field--span-2 { grid-column: 1 / -1; }

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: #142a4d;
    font: 700 .79rem/1.3 'Sora', sans-serif;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.required-mark { color: var(--auth-blue); }

.auth-input {
    position: relative;
}

.auth-input > i {
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 1;
    transform: translateY(-50%);
    color: #7d8aa0;
    font-size: 1.08rem;
    pointer-events: none;
}

.auth-input input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 49px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: #14233e;
    font: 500 .96rem/1 'DM Sans', sans-serif;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-input input::placeholder { color: #929eb0; }

.auth-input input:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(8, 104, 235, .1);
}

.auth-input:focus-within > i { color: var(--auth-blue); }

.auth-field.has-error .auth-input input {
    border-color: #d74a5a;
    background: #fffafb;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: .79rem;
    line-height: 1.4;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 11px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #52627e;
    cursor: pointer;
}

.password-toggle:hover { background: #edf4ff; color: var(--auth-blue); }
.password-toggle:focus-visible { outline: 3px solid rgba(8, 104, 235, .2); }

.auth-extras {
    display: flex;
    justify-content: flex-end;
    margin-top: -5px;
}

.auth-link {
    color: var(--auth-blue);
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    margin-top: 2px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0877f4 0%, #0754db 55%, #083fc0 100%);
    color: #fff;
    font: 700 1rem/1 'Sora', sans-serif;
    box-shadow: 0 12px 26px rgba(7, 85, 216, .25);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.auth-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 15px 32px rgba(7, 85, 216, .3);
}

.auth-primary:focus-visible {
    outline: 3px solid rgba(8, 104, 235, .25);
    outline-offset: 3px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #8591a4;
    font-size: .84rem;
}

.auth-divider::before,
.auth-divider::after {
    flex: 1;
    border-top: 1px solid #e2e8f0;
    content: '';
}

.auth-secondary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    color: #586780;
    text-align: center;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease;
}

.auth-secondary-link i,
.auth-secondary-link strong { color: var(--auth-blue); }
.auth-secondary-link:hover { border-color: #b9cff0; background: #f8fbff; }

.approval-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d5e5fa;
    border-radius: 12px;
    background: #f3f8ff;
    color: #405879;
    font-size: .84rem;
    line-height: 1.5;
}

.approval-note i { color: var(--auth-blue); margin-top: 2px; }

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d5e5fa;
    border-radius: 12px;
    background: #f3f8ff;
    color: #405879;
    font-size: .82rem;
    line-height: 1.45;
}

.privacy-note i { flex: 0 0 auto; margin-top: 2px; color: var(--auth-blue); }
.field-hint { display: block; margin-top: 7px; color: #78869b; font-size: .76rem; line-height: 1.4; }
.recovery-step { display: inline-flex; margin-bottom: 8px; color: var(--auth-blue); font: 700 .72rem/1 'Sora', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.auth-layout--recovery {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
    width: min(100%, 680px);
    gap: 0;
}
.auth-layout--recovery .auth-institution { display: none; }
.auth-layout--recovery .auth-card { max-width: 560px; }
.auth-layout--single {
    grid-template-columns: minmax(0, 640px);
    justify-content: center;
    width: min(100%, 760px);
    gap: 0;
}
.auth-layout--single .auth-institution { display: none; }
.auth-layout--single .auth-card-wrap { width: 100%; }
.auth-layout--single .auth-card--recovery { max-width: 560px; }
.auth-input--code input { font: 700 1.4rem/1 'Sora', sans-serif; letter-spacing: .3em; text-align: center; }

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
    margin-top: clamp(28px, 5vh, 58px);
    color: #78869b;
    font-size: .82rem;
    text-align: center;
}

.auth-footer span:first-child { color: #5e6e87; }
.auth-footer i { margin-right: 5px; color: var(--auth-blue); }

@media (max-width: 980px) {
    .auth-shell { padding-top: 28px; }
    .auth-layout { grid-template-columns: 1fr; width: min(100%, 690px); gap: 28px; }
    .auth-institution { align-items: center; padding: 0; text-align: center; }
    .seplan-mark { width: 58px; height: 62px; gap: 5px; }
    .seplan-copy strong { font-size: 2rem; }
    .seplan-copy small { max-width: 230px; margin-top: 5px; font-size: .78rem; }
    .institution-message { margin-top: 20px; }
    .institution-message h1 { font-size: 1.28rem; }
    .institution-rule,
    .benefit-list { display: none; }
}

@media (max-width: 620px) {
    .auth-shell { padding: 20px 12px 16px; }
    .auth-layout { gap: 20px; }
    .seplan-lockup { gap: 13px; }
    .seplan-mark { width: 47px; height: 51px; gap: 4px; }
    .seplan-copy strong { font-size: 1.72rem; }
    .seplan-copy small { font-size: .67rem; }
    .institution-message { display: none; }
    .auth-card { padding: 27px 20px; border-radius: 19px; }
    .security-badge { width: 66px; height: 66px; margin-bottom: 16px; }
    .auth-card-header { margin-bottom: 23px; }
    .auth-card-header h2 { font-size: 1.55rem; }
    .auth-card-header p { font-size: .91rem; }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-field--span-2 { grid-column: auto; }
    .auth-footer { margin-top: 24px; font-size: .75rem; }
}

@media (max-height: 760px) and (min-width: 981px) {
    .auth-shell { padding-top: 24px; padding-bottom: 16px; }
    .auth-card { padding-top: 30px; padding-bottom: 30px; }
    .security-badge { width: 66px; height: 66px; margin-bottom: 16px; }
    .institution-message { margin-top: 38px; }
    .benefit-list { gap: 17px; }
    .auth-footer { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
