:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --panel-soft: #f7fafc;
    --ink: #0d1728;
    --muted: #66758b;
    --line: #dbe4ee;
    --line-strong: #c6d3e1;
    --blue: #004bff;
    --green: #07966f;
    --amber: #c78916;
    --danger: #c43d52;
    --shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
    --shadow-soft: 0 14px 38px rgba(15, 23, 42, 0.09);
    --radius: 28px;
    --radius-sm: 16px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(0, 75, 255, 0.1), rgba(0, 75, 255, 0.04)),
        var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    letter-spacing: 0;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

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

button,
input {
    font: inherit;
}

input,
textarea,
select,
[contenteditable="true"],
[contenteditable="plaintext-only"] {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
}

.auth-shell {
    width: min(100% - 32px, 560px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 34px 0;
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: 100%;
    display: grid;
    gap: 18px;
    padding: 34px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.auth-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-card-top > div {
    display: grid;
    gap: 7px;
}

.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

h2 {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    line-height: 1.05;
}

.muted {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    padding: 5px;
}

.mode-switch a {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 900;
    padding: 12px 14px;
}

.mode-switch a.is-active {
    background: #ffffff;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

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

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

.auth-form label > span,
.check-row span {
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}

.auth-form small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.auth-form input[type="text"],
.auth-form input[type="tel"],
.auth-form input[type="password"],
.otp-input {
    width: 100%;
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    outline: none;
    padding: 14px 15px;
    font-weight: 850;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:focus,
.otp-input:focus {
    border-color: rgba(0, 75, 255, 0.62);
    box-shadow: 0 0 0 4px rgba(0, 75, 255, 0.14);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 58px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    transform: translateY(-50%);
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--blue);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.eye-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.eye-closed {
    display: none;
}

.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.otp-input {
    text-align: center;
    font-size: 28px;
}

.check-row {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 10px !important;
    width: max-content;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.form-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.text-link {
    color: var(--blue);
    font-size: 13px;
    font-weight: 950;
}

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

.center-link {
    justify-self: center;
}

.button {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 17px;
    cursor: pointer;
    font-weight: 950;
    padding: 13px 18px;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.full {
    width: 100%;
}

.button.primary {
    background: #004bff;
    color: #ffffff;
    box-shadow: 0 15px 32px rgba(0, 75, 255, 0.32);
}

.button.primary:hover {
    background: #003fe0;
}

.button.secondary {
    border-color: var(--line);
    background: #ffffff;
    color: var(--ink);
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--ink);
}

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

.notice {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.9)),
        #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    color: #142033;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.45;
    padding: 14px 16px 14px 14px;
}

.notice::before {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0;
}

.notice::after {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    content: "";
}

.notice.success {
    border-color: rgba(7, 150, 111, 0.18);
    box-shadow: 0 18px 42px rgba(7, 150, 111, 0.1);
}

.notice.success::before {
    content: "OK";
    background: linear-gradient(135deg, #07966f, #16a085);
    box-shadow: 0 10px 22px rgba(7, 150, 111, 0.28);
}

.notice.success::after {
    background: linear-gradient(180deg, #07966f, rgba(7, 150, 111, 0));
}

.notice.error {
    border-color: rgba(196, 61, 82, 0.18);
    box-shadow: 0 18px 42px rgba(196, 61, 82, 0.1);
}

.notice.error::before {
    content: "!";
    background: linear-gradient(135deg, #be314b, #e05266);
    box-shadow: 0 10px 22px rgba(196, 61, 82, 0.28);
}

.notice.error::after {
    background: linear-gradient(180deg, #c43d52, rgba(196, 61, 82, 0));
}

.account-meta {
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
    padding: 14px;
}

.account-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.account-meta strong {
    color: var(--ink);
    font-size: 18px;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .auth-shell {
        align-content: center;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        width: min(100% - 20px, 520px);
        padding: 10px 0;
    }

    .auth-card {
        border-radius: 22px;
        padding: 20px;
    }

    h2 {
        font-size: 27px;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .form-row-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}
