:root {
    color-scheme: light;

    --color-page-bg: #F7F7F7;
    --color-page-bg-mobile: #FFFFFF;
    --page-mesh:
        radial-gradient(60vw 60vw at -8% -12%, rgba(126, 87, 194, 0.20) 0%, rgba(126, 87, 194, 0) 70%),
        radial-gradient(52vw 52vw at 108% -6%, rgba(233, 30, 99, 0.13) 0%, rgba(233, 30, 99, 0) 70%),
        radial-gradient(58vw 46vw at 50% 112%, rgba(126, 87, 194, 0.12) 0%, rgba(126, 87, 194, 0) 70%);

    --color-text-primary: #1E293B;
    --color-text-secondary: #475569;
    --color-text-caption: #64748B;
    --color-text-muted: #94A3B8;
    --color-placeholder: #94A3B8;
    --color-icon-hover: #475569;

    --color-accent: #7E57C2;
    --color-accent-rgb: 126, 87, 194;
    --color-accent-secondary: #E91E63;
    --color-accent-text: #7E57C2;
    --color-accent-soft-bg: rgba(126, 87, 194, 0.08);
    --color-link-hover: #6A3FB5;

    --color-card-bg: #FFFFFF;
    --color-card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 20px 40px rgba(0, 0, 0, 0.06);
    --card-backdrop: none;

    --color-input-bg: #F5F5F5;
    --color-input-bg-focus: #FFFFFF;
    --color-input-border: transparent;
    --color-input-border-hover: rgba(162, 173, 196, 0.15);
    --color-focus-ring: rgba(126, 87, 194, 0.12);
    --color-autofill-bg: #F5F5F5;

    --color-subtle-bg: #F0F0F0;
    --color-divider: rgba(0, 0, 0, 0.08);
    --color-ring-bg: #FFFFFF;

    --btn-primary-bg: linear-gradient(135deg, #7E57C2 0%, #E91E63 100%);
    --btn-primary-shadow: 0 10px 20px -5px rgba(126, 87, 194, 0.35);
    --btn-focus-ring: rgba(126, 87, 194, 0.35);

    --color-ghost-bg: #FFFFFF;
    --color-ghost-border: rgba(0, 0, 0, 0.08);
    --color-ghost-text: #1E293B;
    --color-secondary-text: #1E293B;
    --ghost-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    --color-ghost-hover-bg: #FFFFFF;
    --color-ghost-hover-border: rgba(126, 87, 194, 0.35);
    --color-ghost-hover-text: #7E57C2;
    --ghost-hover-shadow: 0 4px 16px rgba(126, 87, 194, 0.12);

    --color-icon-btn-bg: rgba(0, 0, 0, 0.04);
    --color-icon-btn-hover-bg: rgba(126, 87, 194, 0.08);
    --color-icon-btn-hover-text: #7E57C2;

    --color-success: #16A34A;
    --color-danger: #E91E63;
    --color-danger-text: #E91E63;
    --color-danger-bg: rgba(233, 30, 99, 0.08);
    --color-danger-bg-hover: rgba(233, 30, 99, 0.12);
    --color-note-danger-text: #1E293B;

    --toast-notice-bg: #FFFFFF;
    --toast-notice-border: rgba(0, 0, 0, 0.08);
    --toast-notice-text: #1E293B;
    --toast-notice-icon: #16A34A;
    --toast-alert-bg: #FFFFFF;
    --toast-alert-border: rgba(0, 0, 0, 0.08);
    --toast-alert-text: #1E293B;
    --toast-alert-icon: #E91E63;
    --toast-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    --toast-backdrop: none;

    --color-step-dot: rgba(126, 87, 194, 0.2);
    --step-dot-active-shadow: none;

    --color-menu-bg: #FFFFFF;
    --color-menu-border: rgba(162, 173, 196, 0.15);
    --menu-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    --menu-backdrop: none;
    --color-menu-item-hover: rgba(126, 87, 194, 0.14);
    --color-chip-bg: rgba(0, 0, 0, 0.04);

    --logo-gradient: linear-gradient(135deg, #7E57C2 0% 20%, #E91E63 100%);
    --color-badge-bg: rgba(126, 87, 194, 0.14);
    --color-badge-text: #6A3FB5;
    --color-star: #7E57C2;
    --color-star-alt: #E91E63;
    --star-opacity: 0.5;
    --orb-bg: linear-gradient(135deg, #7E57C2 0%, #E91E63 100%);
    --orb-glow: rgba(126, 87, 194, 0.4);
    --mark-start: #7E57C2;
    --mark-mid: #B43B93;
    --mark-end: #E91E63;
    --status-code-gradient: linear-gradient(135deg, #7E57C2 0%, #E91E63 100%);

    --theme-moon-display: block;
    --theme-sun-display: none;

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 9999px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-medium: 0.25s ease;

    --font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --color-page-bg: #0f172a;
    --color-page-bg-mobile: #0f172a;
    --page-mesh:
        radial-gradient(at 18% 18%, hsla(243, 75%, 59%, 0.42) 0px, transparent 50%),
        radial-gradient(at 85% 82%, hsla(330, 81%, 60%, 0.38) 0px, transparent 50%),
        radial-gradient(at 55% 0%, hsla(225, 39%, 30%, 0.85) 0px, transparent 55%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.70) 0px, transparent 50%);

    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-caption: #94a3b8;
    --color-text-muted: #94a3b8;
    --color-placeholder: #7d8ba1;
    --color-icon-hover: #f8fafc;

    --color-accent: #6366f1;
    --color-accent-rgb: 99, 102, 241;
    --color-accent-secondary: #ef356c;
    --color-accent-text: #a5b4fc;
    --color-accent-soft-bg: rgba(99, 102, 241, 0.18);
    --color-link-hover: #ffffff;

    --color-card-bg: rgba(30, 41, 59, 0.7);
    --color-card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    --card-backdrop: blur(20px);

    --color-input-bg: rgba(15, 23, 42, 0.6);
    --color-input-bg-focus: rgba(15, 23, 42, 0.8);
    --color-input-border: rgba(255, 255, 255, 0.08);
    --color-input-border-hover: rgba(255, 255, 255, 0.2);
    --color-focus-ring: rgba(99, 102, 241, 0.1);
    --color-autofill-bg: #0f172a;

    --color-subtle-bg: rgba(15, 23, 42, 0.6);
    --color-divider: rgba(255, 255, 255, 0.08);
    --color-ring-bg: #1e293b;

    --btn-primary-bg: linear-gradient(135deg, #4159ce 0% 20%, #ef356c 100%);
    --btn-primary-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    --btn-focus-ring: rgba(65, 89, 206, 0.85);

    --color-ghost-bg: rgba(255, 255, 255, 0.05);
    --color-ghost-border: rgba(255, 255, 255, 0.08);
    --color-ghost-text: #f8fafc;
    --color-secondary-text: #94a3b8;
    --ghost-shadow: none;
    --color-ghost-hover-bg: rgba(255, 255, 255, 0.1);
    --color-ghost-hover-border: rgba(255, 255, 255, 0.2);
    --color-ghost-hover-text: #f8fafc;
    --ghost-hover-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);

    --color-icon-btn-bg: rgba(255, 255, 255, 0.05);
    --color-icon-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --color-icon-btn-hover-text: #f8fafc;

    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-danger-text: #fca5a5;
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-danger-bg-hover: rgba(239, 68, 68, 0.2);
    --color-note-danger-text: #fca5a5;

    --toast-notice-bg: rgba(34, 197, 94, 0.15);
    --toast-notice-border: rgba(34, 197, 94, 0.25);
    --toast-notice-text: #86efac;
    --toast-notice-icon: #86efac;
    --toast-alert-bg: rgba(239, 68, 68, 0.15);
    --toast-alert-border: rgba(239, 68, 68, 0.25);
    --toast-alert-text: #fca5a5;
    --toast-alert-icon: #fca5a5;
    --toast-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --toast-backdrop: blur(20px);

    --color-step-dot: rgba(255, 255, 255, 0.15);
    --step-dot-active-shadow: 0 0 8px rgba(99, 102, 241, 0.4);

    --color-menu-bg: rgba(30, 41, 59, 0.95);
    --color-menu-border: rgba(255, 255, 255, 0.08);
    --menu-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --menu-backdrop: blur(20px);
    --color-menu-item-hover: rgba(255, 255, 255, 0.06);
    --color-chip-bg: rgba(255, 255, 255, 0.06);

    --logo-gradient: linear-gradient(#f8fafc, #f8fafc);
    --color-badge-bg: #f8fafc;
    --color-badge-text: #0f172a;
    --color-star: rgba(255, 255, 255, 0.9);
    --color-star-alt: rgba(255, 255, 255, 0.9);
    --star-opacity: 0.75;
    --orb-bg: rgba(255, 255, 255, 0.9);
    --orb-glow: rgba(255, 255, 255, 0.35);
    --mark-start: #6274f0;
    --mark-mid: #b055d0;
    --mark-end: #f7456f;
    --status-code-gradient: linear-gradient(135deg, #6274f0, #b055d0, #f7456f);

    --theme-moon-display: none;
    --theme-sun-display: block;
}

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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-page-bg);
    background-image: var(--page-mesh);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
    .theme-transition,
    .theme-transition *,
    .theme-transition *::before,
    .theme-transition *::after {
        transition:
            background-color 0.3s ease,
            border-color 0.3s ease,
            color 0.3s ease,
            box-shadow 0.3s ease,
            stop-color 0.3s ease !important;
    }
}

.turbo-progress-bar {
    height: 3px;
    background: var(--btn-primary-bg);
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding:
        max(16px, env(safe-area-inset-top))
        max(32px, env(safe-area-inset-right))
        16px
        max(32px, env(safe-area-inset-left));
}

.auth-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.auth-brand {
    display: inline-block;
    min-width: 0;
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
}

.pointed-mark__start {
    stop-color: var(--mark-start);
}

.pointed-mark__mid {
    stop-color: var(--mark-mid);
}

.pointed-mark__end {
    stop-color: var(--mark-end);
}

.auth-brand__wordmark {
    font-weight: 700;
    letter-spacing: -0.033em;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.auth-brand__badge {
    display: inline-block;
    overflow: hidden;
    width: 1.2em;
    height: 1.2em;
    margin-left: 0.267em;
    padding: 0.03em 0 0;
    border-radius: 0.33em;
    background: var(--color-badge-bg);
    color: var(--color-badge-text);
    font-size: 0.81em;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    vertical-align: -0.187em;
}

.auth-card-mark {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-normal), color var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--color-icon-btn-hover-bg);
    color: var(--color-text-primary);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.theme-toggle__icon {
    width: 20px;
    height: 20px;
}

.theme-toggle__icon--moon {
    display: var(--theme-moon-display);
}

.theme-toggle__icon--sun {
    display: var(--theme-sun-display);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        24px
        max(16px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    -webkit-backdrop-filter: var(--card-backdrop);
    backdrop-filter: var(--card-backdrop);
    animation: auth-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-hero__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-accent-soft-bg);
    color: var(--color-accent-text);
}

.auth-hero__icon svg {
    width: 30px;
    height: 30px;
}

.auth-hero__icon--danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.auth-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.6px;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
}

.auth-subtitle {
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.auth-subtitle strong {
    font-weight: 600;
    color: var(--color-accent-text);
}

.auth-container a:not(.btn) {
    color: var(--color-accent-text);
}

.field {
    margin-bottom: 18px;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row .field {
    flex: 1;
    min-width: 0;
}

.auth-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-normal);
}

.field:focus-within label {
    color: var(--color-accent-text);
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-caption);
}

.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"],
.auth-container input[type="datetime-local"],
.auth-container select,
.auth-container textarea {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    font-family: inherit;
    font-size: 16px;
    color: var(--color-text-primary);
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        background var(--transition-normal);
}

.auth-container textarea {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
}

.auth-container input::placeholder,
.auth-container textarea::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

.auth-container :is(input[type="email"], input[type="password"], input[type="text"], input[type="datetime-local"], select, textarea):hover {
    border-color: var(--color-input-border-hover);
}

.auth-container :is(input[type="email"], input[type="password"], input[type="text"], input[type="datetime-local"], select, textarea):focus {
    background: var(--color-input-bg-focus);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-focus-ring);
}

.auth-container input:-webkit-autofill,
.auth-container input:-webkit-autofill:hover,
.auth-container input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px var(--color-autofill-bg) inset;
    -webkit-text-fill-color: var(--color-text-primary);
    caret-color: var(--color-text-primary);
    transition: background-color 5000s ease-in-out 0s;
}

.field_with_errors {
    display: contents;
}

.field_with_errors label {
    color: var(--color-danger-text);
}

.auth-container .field_with_errors input,
.auth-container input.field-error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 4px var(--color-danger-bg);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-icon-hover);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -6px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-toggle .icon-eye-off,
.password-toggle[aria-pressed="true"] .icon-eye {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
    display: block;
}

.actions {
    margin-top: 26px;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition:
        transform var(--transition-normal),
        box-shadow var(--transition-normal),
        background var(--transition-normal),
        border-color var(--transition-normal),
        color var(--transition-normal);
}

.btn:focus-visible {
    outline: 3px solid var(--btn-focus-ring);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: transparent;
    background-image:
        linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 80%),
        var(--btn-primary-bg);
    background-size: 50% 100%, 100% 100%;
    background-position: -110% 0, 0 0;
    background-repeat: no-repeat;
    color: #FFFFFF;
    box-shadow: var(--btn-primary-shadow);
    transition:
        background-position 0.6s ease,
        transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

@media (prefers-reduced-motion: no-preference) {
    .btn-primary:focus-visible {
        background-position: 210% 0, 0 0;
    }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background-position: 210% 0, 0 0;
    }
}

.btn-secondary {
    background: var(--color-ghost-bg);
    color: var(--color-secondary-text);
    border: 1px solid var(--color-ghost-border);
    box-shadow: var(--ghost-shadow);
}

.btn-danger {
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.btn-danger:hover {
    background: var(--color-danger-bg-hover);
}

@media (hover: hover) and (pointer: fine) {
    .btn-secondary:hover {
        background: var(--color-ghost-hover-bg);
        border-color: var(--color-ghost-hover-border);
        color: var(--color-ghost-hover-text);
        box-shadow: var(--ghost-hover-shadow);
    }
}

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-stack form {
    margin: 0;
}

.btn.btn-inline {
    display: inline-flex;
    width: auto;
    padding: 0 32px;
}

.links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 20px;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.links-row a {
    font-weight: 600;
    color: var(--color-accent-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.links-row a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-divider);
}

.social-buttons-row {
    display: flex;
    gap: 12px;
}

.social-buttons-row form {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--color-ghost-border);
    border-radius: var(--radius-pill);
    background: var(--color-ghost-bg);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-ghost-text);
    cursor: pointer;
    transition:
        background var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
}

.btn-social svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-social span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-social:focus-visible {
    outline: 3px solid var(--btn-focus-ring);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-social:hover {
        background: var(--color-ghost-hover-bg);
        border-color: var(--color-ghost-hover-border);
        box-shadow: var(--ghost-hover-shadow);
    }
}

.reg-back-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--color-icon-btn-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.reg-back-btn:hover {
    background: var(--color-icon-btn-hover-bg);
    color: var(--color-icon-btn-hover-text);
}

.reg-back-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 22px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-step-dot);
    transition: width var(--transition-medium), background var(--transition-medium);
}

.step-dot.active {
    width: 24px;
    background: var(--color-accent);
    box-shadow: var(--step-dot-active-shadow);
}

.auth-email-chip {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 16px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft-bg);
    color: var(--color-accent-text);
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}

.auth-note {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--color-subtle-bg);
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-secondary);
    text-align: center;
}

.auth-note--danger {
    background: var(--color-danger-bg);
    color: var(--color-note-danger-text);
    text-align: left;
    overflow-wrap: anywhere;
}

.auth-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-divider);
}

.auth-section__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.auth-section__text {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.auth-section form {
    margin: 0;
}

.auth-code {
    display: block;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--color-input-bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    text-align: center;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
    user-select: all;
}

.consent-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.consent-link__node {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-ghost-bg);
    border: 1px solid var(--color-ghost-border);
    box-shadow: var(--ghost-shadow);
}

.consent-link__node--app {
    background: var(--color-accent-soft-bg);
    border-color: transparent;
    box-shadow: none;
    color: var(--color-accent-text);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.consent-link__mark {
    display: block;
    width: 30px;
    height: 30px;
}

.consent-link__path {
    position: relative;
    width: 72px;
    height: 2px;
    background-image: linear-gradient(90deg, rgba(var(--color-accent-rgb), 0.45) 50%, transparent 50%);
    background-size: 8px 2px;
    background-repeat: repeat-x;
}

.consent-link__path::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    box-shadow: 0 0 0 4px var(--color-ring-bg), 0 0 12px rgba(var(--color-accent-rgb), 0.5);
    transform: translate(-50%, -50%);
}

.consent-scopes {
    margin: 0 0 24px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: var(--color-subtle-bg);
}

.consent-scopes__title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.consent-scopes__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.consent-scopes__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.consent-scopes__item svg {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--color-success);
}

.status-page {
    text-align: center;
}

.status-page-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.status-page-code {
    margin: 0 0 12px;
    font-size: 88px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -3px;
    background: var(--status-code-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.status-page-heading {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.4px;
    color: var(--color-text-primary);
}

.status-page-message {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.status-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.flash-toast-container {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 440px;
    transform: translateX(-50%);
    pointer-events: none;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--toast-notice-border);
    border-radius: var(--radius-md);
    background: var(--toast-notice-bg);
    box-shadow: var(--toast-shadow);
    -webkit-backdrop-filter: var(--toast-backdrop);
    backdrop-filter: var(--toast-backdrop);
    font-size: 14px;
    line-height: 1.5;
    color: var(--toast-notice-text);
    pointer-events: auto;
    animation:
        toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        toast-out 0.4s 4.6s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.flash-message.alert {
    border-color: var(--toast-alert-border);
    background: var(--toast-alert-bg);
    color: var(--toast-alert-text);
}

.flash-message.notice .flash-icon {
    color: var(--toast-notice-icon);
}

.flash-message.alert .flash-icon {
    color: var(--toast-alert-icon);
}

.flash-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.flash-list {
    margin: 0;
    padding-left: 18px;
}

.flash-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px) scale(0.97);
    }
}

.lang-switcher {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.lang-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background var(--transition-normal);
}

.lang-switcher__trigger:hover,
.lang-switcher__trigger[aria-expanded="true"] {
    background: var(--color-icon-btn-hover-bg);
}

.lang-switcher__trigger:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.lang-switcher__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.lang-switcher__chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: transform var(--transition-normal);
}

.lang-switcher__trigger[aria-expanded="true"] .lang-switcher__chevron {
    transform: rotate(180deg);
}

.lang-switcher__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    min-width: 180px;
    margin: 0;
    padding: 4px;
    background: var(--color-menu-bg);
    border: 1px solid var(--color-menu-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--menu-shadow);
    -webkit-backdrop-filter: var(--menu-backdrop);
    backdrop-filter: var(--menu-backdrop);
    transform-origin: top right;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    pointer-events: none;
}

.lang-switcher.is-open .lang-switcher__menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-switcher__item:hover,
.lang-switcher__item:focus-visible {
    outline: none;
    background: var(--color-menu-item-hover);
    color: var(--color-text-primary);
}

.lang-switcher__item--active {
    font-weight: 500;
    color: var(--color-accent-text);
}

.lang-switcher__short {
    min-width: 30px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-chip-bg);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.lang-switcher__item--active .lang-switcher__short {
    background: var(--color-accent-soft-bg);
    color: var(--color-accent-text);
}

.lang-switcher__name {
    flex: 1;
}

.lang-switcher__check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-accent-text);
}

.auth-decor {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-decor__star {
    position: absolute;
    font-size: 18px;
    line-height: 1;
    color: var(--color-star);
    opacity: var(--star-opacity);
}

.auth-decor__star--1 {
    top: 20%;
    left: 12%;
}

.auth-decor__star--2 {
    top: 13%;
    right: 15%;
    font-size: 24px;
    color: var(--color-star-alt);
    animation: auth-twinkle 4s ease-in-out infinite;
}

.auth-decor__star--3 {
    bottom: 16%;
    left: 24%;
    font-size: 14px;
}

.auth-decor__orb {
    position: absolute;
    right: 20%;
    bottom: 22%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--orb-bg);
    box-shadow: 0 0 32px var(--orb-glow);
    opacity: var(--star-opacity);
}

@keyframes auth-twinkle {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.9) rotate(0deg);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(15deg);
    }
}

@media (max-width: 600px) {
    body {
        background-color: var(--color-page-bg-mobile);
    }

    .auth-decor {
        display: none;
    }

    .auth-header {
        padding:
            max(12px, env(safe-area-inset-top))
            max(20px, env(safe-area-inset-right))
            8px
            max(20px, env(safe-area-inset-left));
    }

    .auth-header__actions {
        gap: 0;
    }

    .auth-brand {
        font-size: 22px;
    }

    .auth-card-mark {
        width: 34px;
        height: 34px;
        margin-bottom: 10px;
    }

    .lang-switcher__label {
        display: none;
    }

    .lang-switcher__trigger {
        justify-content: center;
        gap: 6px;
        min-width: 44px;
        padding: 0 10px;
    }

    .auth-main {
        align-items: flex-start;
        padding:
            16px
            max(20px, env(safe-area-inset-right))
            max(36px, calc(env(safe-area-inset-bottom) + 24px))
            max(20px, env(safe-area-inset-left));
    }

    .auth-container {
        max-width: none;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        animation: none;
    }

    .auth-card-head {
        margin-bottom: 24px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .reg-back-btn {
        top: -8px;
        left: 0;
        width: 44px;
        height: 44px;
    }

    .links-row {
        gap: 0 16px;
        margin-top: 12px;
    }

    .links-row a {
        padding: 12px 4px;
    }

    .status-page-code {
        font-size: 64px;
    }
}

@media (min-width: 900px) {
    .auth-header {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        z-index: 2;
        pointer-events: none;
    }

    .auth-header > * {
        pointer-events: auto;
    }
}

@media (min-width: 601px) and (max-height: 820px) {
    .auth-container {
        padding: 28px 36px;
    }

    .auth-card-mark {
        width: 34px;
        height: 34px;
        margin-bottom: 8px;
    }

    .auth-card-head {
        margin-bottom: 20px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        margin-top: 6px;
        font-size: 14px;
    }

    .auth-hero {
        margin-bottom: 14px;
    }

    .auth-container label {
        margin-bottom: 6px;
    }

    .field {
        margin-bottom: 14px;
    }

    .auth-container input[type="email"],
    .auth-container input[type="password"],
    .auth-container input[type="text"],
    .password-toggle {
        height: 46px;
    }

    .actions {
        margin-top: 18px;
    }

    .btn {
        min-height: 48px;
    }

    .links-row {
        margin-top: 12px;
    }

    .auth-divider {
        margin: 18px 0 12px;
    }

    .btn-social {
        min-height: 44px;
    }

    .step-indicator {
        margin-bottom: 16px;
    }

    .reg-back-btn {
        top: 20px;
        left: 20px;
    }
}

@media (min-width: 601px) and (max-height: 680px) {
    .auth-container {
        padding: 22px 32px;
    }

    .auth-card-mark {
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
    }

    .auth-card-head {
        margin-bottom: 16px;
    }

    .field {
        margin-bottom: 12px;
    }

    .auth-divider {
        margin: 14px 0 10px;
    }
}

@media (max-height: 640px) {
    .auth-card-head {
        margin-bottom: 20px;
    }

    .auth-hero {
        margin-bottom: 14px;
    }

}

@media (max-width: 360px) {
    .field-row {
        flex-direction: column;
        gap: 0;
    }

    .social-buttons-row {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-container,
    .flash-message,
    .auth-decor__star {
        animation: none;
    }

    .btn,
    .step-dot,
    .theme-toggle,
    .lang-switcher__menu {
        transition: none;
    }
}
