:root {
    --red: #d71920;
    --deep: #b80f1a;
    --coral: #e85a5f;
    --ink: #18191d;
    --muted: #656871;
    --line: #e2e3e7;
    --success: #18784b;
    --danger: #aa1019;
    --shadow: 0 24px 70px rgba(81, 22, 26, .12)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100dvh;
    background: #f3f3f5;
    color: var(--ink);
    font-family: "Alexandria", Arial, sans-serif;
    -webkit-font-smoothing: antialiased
}

button,
input,
select {
    font: inherit
}

button,
a {
    -webkit-tap-highlight-color: transparent
}

button {
    cursor: pointer
}

a {
    color: inherit;
    text-decoration: none
}

[hidden] {
    display: none !important
}

.auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(440px, .9fr) minmax(600px, 1.1fr);
    direction: ltr
}

.auth-visual,
.auth-panel {
    direction: rtl;
    min-width: 0
}

.auth-visual {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: hidden;
    padding: clamp(30px, 4vw, 58px);
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(145deg, #8f0d16 0%, var(--deep) 24%, var(--red) 58%, var(--coral) 100%)
}

.auth-visual:after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .04), transparent 35%, rgba(80, 0, 5, .12))
}

.visual-orb {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    pointer-events: none
}

.orb-one {
    width: 540px;
    height: 540px;
    top: -290px;
    left: -200px;
    box-shadow: 0 0 0 65px rgba(255, 255, 255, .035), 0 0 0 130px rgba(255, 255, 255, .025)
}

.orb-two {
    width: 470px;
    height: 470px;
    right: -290px;
    bottom: -250px;
    box-shadow: 0 0 0 70px rgba(255, 255, 255, .04), 0 0 0 140px rgba(255, 255, 255, .022)
}

.brand {
    position: relative;
    z-index: 2;
    width: max-content;
    display: flex;
    align-items: center;
    gap: 14px
}

.brand-mark {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: transparent;
    box-shadow: none
}

.brand-mark img {
    width: 58px;
    height: 58px;
    display: block;
    object-fit: contain;
    background: transparent
}

.brand-name {
    display: grid;
    gap: 1px
}

.brand-name strong {
    font-size: 23px;
    line-height: 1.35
}

.brand-name small {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .74)
}

.visual-copy {
    position: relative;
    z-index: 2;
    margin: auto 0;
    max-width: 650px;
    text-align: right
}

.visual-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #ffe7e8
}

.visual-kicker i {
    width: 28px;
    height: 2px;
    border-radius: 3px;
    background: #fff
}

.visual-copy h2 {
    margin: 22px 0 26px;
    font-size: clamp(44px, 4.5vw, 70px);
    line-height: 1.42;
    letter-spacing: 0;
    word-spacing: .1em;
    text-wrap: balance
}

.visual-copy h2 em {
    display: block;
    margin-top: .08em;
    color: #fff;
    font-style: normal;
    line-height: 1.42
}

.visual-copy p {
    max-width: 570px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 2.15;
    word-spacing: .06em;
    text-wrap: pretty
}

.visual-points {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px
}

.visual-points article {
    min-width: 0;
    padding: 14px 12px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 17px;
    background: rgba(91, 0, 7, .12);
    backdrop-filter: blur(8px)
}

.visual-points article>span {
    flex: 0 0 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .14);
    font-size: 9px;
    font-weight: 800
}

.visual-points b,
.visual-points small {
    display: block
}

.visual-points b {
    margin-bottom: 4px;
    font-size: 12px
}

.visual-points small {
    color: rgba(255, 255, 255, .7);
    font-size: 10px;
    line-height: 1.6
}

.auth-panel {
    min-height: 100dvh;
    padding: 28px clamp(24px, 5vw, 78px) 32px;
    display: grid;
    align-items: center;
    background: radial-gradient(circle at 90% 0, rgba(215, 25, 32, .055), transparent 26%), #f6f6f8
}

.panel-inner {
    width: min(700px, 100%);
    margin: auto
}

.panel-top {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px
}

.back-home {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #585b64;
    font-size: 13px;
    font-weight: 700;
    transition: .2s
}

.back-home span {
    font-size: 18px
}

.back-home:hover {
    color: var(--deep);
    transform: translateX(2px)
}

.secure-badge {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #555861;
    font-size: 11px;
    font-weight: 600
}

.secure-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2c9b67;
    box-shadow: 0 0 0 3px rgba(44, 155, 103, .11)
}

.auth-card {
    padding: clamp(24px, 3.5vw, 40px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow)
}

.mobile-brand {
    display: none
}

.auth-tabs {
    margin-bottom: 28px;
    padding: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f3f3f5
}

.auth-tabs button {
    min-height: 43px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #73767f;
    font-size: 13px;
    font-weight: 700;
    transition: .2s
}

.auth-tabs button.active {
    background: #fff;
    color: var(--deep);
    box-shadow: 0 5px 16px rgba(36, 22, 24, .08)
}

.auth-form {
    display: none
}

.auth-form.active {
    display: block;
    animation: form-in .36s cubic-bezier(.2, .8, .2, 1) both
}

@keyframes form-in {
    from {
        opacity: 0;
        transform: translateY(9px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.form-head {
    margin-bottom: 25px
}

.form-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em
}

.form-head h1 {
    margin: 0 0 8px;
    font-size: clamp(29px, 3.5vw, 40px);
    line-height: 1.25;
    letter-spacing: -.035em
}

.form-head p {
    max-width: 550px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.85
}

.fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 13px
}

.field {
    min-width: 0;
    display: grid;
    gap: 8px
}

.field.full,
.form-section-title,
.grade-note,
.terms {
    grid-column: 1/-1
}

.field>span:first-child {
    font-size: 12px;
    font-weight: 700
}

.field>span small {
    margin-inline-start: 4px;
    color: var(--deep);
    font-size: 9px;
    font-weight: 600
}

.input-wrap {
    position: relative;
    display: block
}

.field input,
.field select {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1px solid #d9dade;
    border-radius: 13px;
    outline: 0;
    background: #f8f8f9;
    color: var(--ink);
    font-size: 13px;
    transition: border-color .18s, box-shadow .18s, background .18s
}

.field input:hover,
.field select:hover {
    border-color: #c6c7cd
}

.field input:focus,
.field select:focus {
    border-color: var(--red);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(215, 25, 32, .09)
}

.field input::placeholder {
    color: #92949c
}

.field input:user-invalid,
.field select:user-invalid {
    border-color: #cf4b52
}

.field select {
    padding-left: 38px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #60626a 50%), linear-gradient(135deg, #60626a 50%, transparent 50%);
    background-position: 18px 23px, 13px 23px;
    background-size: 5px 5px;
    background-repeat: no-repeat
}

.field-icon {
    position: absolute;
    z-index: 2;
    right: 14px;
    top: 50%;
    color: #8b8d95;
    font-size: 14px;
    font-weight: 700;
    transform: translateY(-50%)
}

.field-icon+input {
    padding-right: 42px
}

.lock-icon {
    font-size: 8px
}

.password-toggle {
    position: absolute;
    left: 7px;
    top: 50%;
    height: 36px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #62656d;
    font-size: 10px;
    font-weight: 700;
    transform: translateY(-50%);
    transition: .2s
}

.password-toggle:hover {
    background: #ededf0;
    color: var(--deep)
}

.input-wrap input[type=password],
.input-wrap input[type=text] {
    padding-left: 65px
}

.forgot-row {
    margin: 13px 0 17px;
    display: flex;
    justify-content: flex-end
}

.forgot-row button,
.switch-row button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--deep);
    font-size: 11px;
    font-weight: 800
}

.forgot-row button:hover,
.switch-row button:hover {
    text-decoration: underline;
    text-underline-offset: 3px
}

.submit-btn {
    width: 100%;
    height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--deep), var(--red) 58%, var(--coral));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 13px 28px rgba(184, 15, 26, .22);
    transition: .2s
}

.submit-btn i {
    font-size: 18px;
    font-style: normal;
    transition: transform .2s
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 32px rgba(184, 15, 26, .28)
}

.submit-btn:hover i {
    transform: translateX(-3px)
}

.submit-btn:disabled {
    cursor: wait;
    opacity: .7;
    transform: none;
    box-shadow: none
}

.submit-btn.is-loading i {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    font-size: 0;
    animation: spin .7s linear infinite
}

.switch-row {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: #6b6e77;
    font-size: 12px
}

.form-section-title {
    margin: 5px 0 0;
    padding-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #303239;
    font-size: 12px;
    font-weight: 800
}

.form-section-title span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fae7e8;
    color: var(--deep);
    font-size: 10px
}

.form-section-title:after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line)
}

.grade-note {
    padding: 12px 13px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid #efc9cc;
    border-radius: 12px;
    background: #fff7f7;
    color: #651219;
    font-size: 11px;
    line-height: 1.7
}

.grade-note b {
    flex: 0 0 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--deep);
    color: #fff
}

.grade-note strong {
    display: block;
    margin-bottom: 1px
}

.terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #5e6169;
    font-size: 11px;
    line-height: 1.7
}

.terms input {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--red)
}

.signup-submit {
    margin-top: 20px
}

.auth-message {
    margin: 16px 0 0;
    padding: 11px 13px;
    border: 1px solid #f0c8cb;
    border-radius: 11px;
    background: #fff2f3;
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.7;
    text-align: center
}

.auth-message.success {
    border-color: #c4e4d4;
    background: #f0faf5;
    color: #18784b
}

.panel-foot {
    margin: 14px 0 0;
    color: #777a82;
    font-size: 10px;
    line-height: 1.7;
    text-align: center
}

.loading-screen {
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding: 24px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    background: rgba(250, 250, 251, .96);
    backdrop-filter: blur(12px)
}

.loader-mark {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(85, 16, 21, .12)
}

.loader-mark img {
    width: 46px;
    height: 46px;
    object-fit: contain
}

.loader-ring {
    width: 28px;
    height: 28px;
    margin: 19px 0 4px;
    border: 3px solid #e6e7ea;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .75s linear infinite
}

.loading-screen strong {
    font-size: 17px
}

.loading-screen p {
    max-width: 320px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7
}

@keyframes spin {
    to {
        transform: rotate(1turn)
    }
}

:focus-visible {
    outline: 3px solid rgba(215, 25, 32, .2);
    outline-offset: 3px
}

@media(max-width:1050px) {
    .auth-shell {
        grid-template-columns: minmax(360px, .78fr) minmax(540px, 1.22fr)
    }

    .visual-points {
        grid-template-columns: 1fr
    }

    .visual-points article {
        padding: 10px 12px
    }

    .visual-copy h2 {
        font-size: 48px
    }
}

@media(max-width:860px) {
    .auth-shell {
        display: block
    }

    .auth-visual {
        position: relative;
        height: auto;
        min-height: 310px;
        padding: 26px 28px 96px
    }

    .brand-name {
        display: none
    }

    .visual-copy {
        margin: 55px 0 0
    }

    .visual-copy h2 {
        max-width: 560px;
        margin-block: 16px 20px;
        font-size: 40px;
        line-height: 1.45
    }

    .visual-copy p {
        font-size: 14px;
        line-height: 2
    }

    .visual-points {
        display: none
    }

    .auth-panel {
        min-height: auto;
        padding: 0 18px 42px
    }

    .panel-inner {
        position: relative;
        z-index: 5;
        margin-top: -68px
    }

    .panel-top {
        padding: 0 10px
    }

    .back-home {
        color: #fff
    }

    .secure-badge {
        background: rgba(255, 255, 255, .92)
    }

    .auth-card {
        border-radius: 24px
    }
}

@media(max-width:580px) {
    .auth-visual {
        min-height: 255px;
        padding: 20px 20px 78px
    }

    .brand-mark {
        width: 56px;
        height: 56px;
        border-radius: 0
    }

    .brand-mark img {
        width: 50px;
        height: 50px
    }

    .visual-copy {
        margin-top: 32px
    }

    .visual-kicker {
        font-size: 11px
    }

    .visual-copy h2 {
        margin-block: 14px 18px;
        font-size: 32px;
        line-height: 1.48;
        word-spacing: .08em
    }

    .visual-copy p {
        display: none
    }

    .auth-panel {
        padding-inline: 10px
    }

    .panel-inner {
        margin-top: -50px
    }

    .panel-top {
        margin-bottom: 12px;
        padding-inline: 7px
    }

    .back-home {
        font-size: 11px
    }

    .secure-badge {
        padding: 7px 9px;
        font-size: 9px
    }

    .auth-card {
        padding: 19px 15px 23px;
        border-radius: 20px
    }

    .mobile-brand {
        display: flex;
        margin: 0 0 16px;
        align-items: center;
        justify-content: center;
        gap: 7px
    }

    .mobile-brand img {
        width: 28px;
        height: 28px
    }

    .mobile-brand strong {
        font-size: 16px
    }

    .auth-tabs {
        margin-bottom: 23px
    }

    .form-head {
        margin-bottom: 22px
    }

    .form-head h1 {
        font-size: 28px
    }

    .form-head p {
        font-size: 12px
    }

    .fields {
        grid-template-columns: 1fr;
        gap: 14px
    }

    .field.full,
    .form-section-title,
    .grade-note,
    .terms {
        grid-column: auto
    }

    .field input,
    .field select {
        height: 51px;
        font-size: 16px
    }

    .submit-btn {
        height: 52px
    }

    .switch-row {
        flex-wrap: wrap
    }

    .panel-foot {
        padding-inline: 12px
    }

    .loading-screen strong {
        font-size: 15px
    }
}

@media(max-width:370px) {
    .auth-card {
        padding-inline: 12px
    }

    .visual-copy h2 {
        font-size: 30px
    }

    .auth-tabs button {
        font-size: 12px
    }

    .grade-note {
        font-size: 10px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *:before,
    *:after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important
    }
}
