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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Ubuntu", sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.auth-shell {
    display: grid;
    min-height: 100dvh;
    width: 100%;
}

.auth-hero {
    display: none;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 35%),
        radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 40%),
        linear-gradient(160deg, #0b0b0d 0%, #111114 45%, #09090b 100%);
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}

.auth-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    height: 100%;
    padding: clamp(2rem, 6vw, 4rem);
}

.auth-hero__brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-hero__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--primary) 35%, transparent));
}

.auth-hero__logo .platform-logo {
    width: 4.5rem;
    height: 4.5rem;
}

.auth-hero__taglines p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(250, 250, 250, 0.92);
}

.auth-hero__title {
    margin: 0;
    max-width: 16ch;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-hero__title span {
    color: var(--link-color);
}

.auth-panel {
    position: relative;
    overflow: hidden;
    min-height: 100dvh;
}

.auth-panel__scroll {
    height: 100%;
    overflow-y: auto;
}

.auth-panel__inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: min(100%, 28rem);
    margin: 0 auto;
    min-height: 100dvh;
    padding: 1rem 1.25rem 2rem;
    justify-content: center;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.auth-brand__icon svg {
    width: 3rem;
    height: 3rem;
}

.auth-brand__wordmark {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--link-color);
}

.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    line-height: 1.4;
}

.auth-alert--error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.auth-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.auth-form {
    display: grid;
    gap: 1.5rem;
}

.auth-form__header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.auth-form__header p {
    margin: 0;
    max-width: 40ch;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--muted-foreground);
}

.auth-form__fields {
    display: grid;
    gap: 1rem;
}

.auth-form--register {
    gap: 1.25rem;
}

.auth-register-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.5rem;
}

.auth-register-steps__item {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-weight: 700;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.auth-register-steps__item.is-active {
    border-color: var(--button-bg);
    background: var(--icon-badge-soft);
    color: var(--link-color);
}

.auth-register-steps__item.is-done {
    border-color: var(--button-bg);
    background: var(--button-bg);
    color: var(--button-fg);
}

.auth-register-steps__line {
    width: 3rem;
    height: 2px;
    background: var(--border);
    border-radius: 999px;
}

.auth-form__step {
    display: none;
    gap: 1rem;
}

.auth-form__step.is-active {
    display: grid;
}

.auth-form__actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.75rem;
}

.auth-button--ghost {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.auth-button--ghost:hover {
    background: var(--muted);
}

.auth-field-error {
    margin: 0;
    font-size: 0.8125rem;
    color: #f87171;
    line-height: 1.4;
}

.auth-field-error[hidden] {
    display: none;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.field__control {
    position: relative;
}

.field__icon,
.field__toggle {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: var(--muted-foreground);
}

.field__toggle {
    left: 1rem;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.field__control input {
    width: 100%;
    height: 3.125rem;
    padding: 0.75rem 0.75rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    font: inherit;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__control input::placeholder {
    color: var(--muted-foreground);
}

.field__control input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(250, 250, 250, 0.08);
}

.auth-link {
    color: var(--link-color);
    text-decoration: none;
}

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

.auth-link--small {
    font-size: 0.75rem;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 3.125rem;
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--button-fg);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.auth-button svg {
    width: 1.125rem;
    height: 1.125rem;
}

.auth-button:hover {
    background: var(--button-bg-hover);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-footer {
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }

    .auth-hero {
        display: block;
    }

    .auth-panel__inner {
        width: min(100%, 70%);
        min-width: 40%;
        max-width: 28rem;
    }
}

@media (max-width: 1023px) {
    .auth-panel__inner {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

.auth-shell--verify {
    position: relative;
}

.auth-panel--blurred {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

.verify-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
}

.verify-modal {
    position: relative;
    width: min(100%, 425px);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.verify-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--muted-foreground);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.verify-modal__close:hover {
    opacity: 1;
}

.verify-modal__close svg {
    width: 1rem;
    height: 1rem;
}

.verify-modal__title-wrap {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0 0.5rem 0.5rem;
    border-left: 4px solid var(--link-color);
    border-radius: var(--radius);
}

.verify-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
}

.verify-modal__text {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted-foreground);
}

.verify-modal__text strong {
    color: var(--foreground);
    font-weight: 600;
}

.verify-alert {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--primary-soft-35);
    border-radius: var(--radius);
    color: var(--link-color);
}

.verify-alert svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
}

.verify-alert h3 {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.verify-alert p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted-foreground);
}

.verify-alert strong {
    color: var(--foreground);
}

.verify-form {
    display: grid;
    gap: 1rem;
}

.verify-otp {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.verify-otp__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    font-size: 1rem;
    font-weight: 600;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.verify-otp__box.is-filled {
    border-color: var(--ring);
}

.verify-otp__box.is-active {
    border-color: var(--button-bg);
    box-shadow: 0 0 0 2px var(--primary-soft-15);
}

.verify-otp__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    outline: none;
    font-size: 1rem;
    letter-spacing: 0.45em;
    text-align: center;
}

.verify-form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.verify-resend {
    margin-top: 0.25rem;
    text-align: center;
}

.verify-resend__button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--muted-foreground);
    font: inherit;
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
}

.verify-resend__button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    text-decoration: none;
}

.verify-resend__button:not(:disabled):hover {
    color: var(--link-color);
}

