:root {
    --auth-primary: #1A237E;
    --auth-primary-deep: #131B63;
    --auth-accent: #FF6D00;
    --auth-accent-soft: rgba(255, 109, 0, 0.14);
    --auth-ink: #172033;
    --auth-muted: #5D6B82;
    --auth-line: rgba(23, 32, 51, 0.08);
    --auth-line-strong: rgba(26, 35, 126, 0.18);
    --auth-surface: rgba(255, 255, 255, 0.9);
    --auth-surface-solid: #FFFFFF;
    --auth-soft: #F5F7FB;
    --auth-soft-blue: #EEF3FF;
    --auth-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
    --auth-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --auth-danger: #DC2626;
    --auth-danger-soft: rgba(220, 38, 38, 0.08);
    --auth-success: #15803D;
    --auth-success-soft: rgba(21, 128, 61, 0.08);
    --auth-warning: #D97706;
    --auth-radius-xl: 32px;
    --auth-radius-lg: 22px;
    --auth-radius-md: 16px;
    --auth-radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at top left, rgba(255, 109, 0, 0.16), transparent 26%),
        radial-gradient(circle at bottom right, rgba(26, 35, 126, 0.18), transparent 32%),
        linear-gradient(180deg, #F7F9FC 0%, #EEF3F9 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 2.8vw, 34px);
}

.auth-shell {
    width: min(1240px, 100%);
    min-height: min(740px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(390px, 0.84fr) minmax(460px, 1.16fr);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: calc(var(--auth-radius-xl) + 4px);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.auth-shell--single {
    width: min(620px, 100%);
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
}

.auth-panel {
    position: relative;
    padding: 26px 28px 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: 20px 20px auto auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 109, 0, 0.12) 0%, transparent 68%);
    pointer-events: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.auth-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(26, 35, 126, 0.12), rgba(255, 109, 0, 0.16));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(26, 35, 126, 0.08);
}

.auth-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-brand-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-brand-copy small {
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.auth-header {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 109, 0, 0.12);
    color: var(--auth-accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-header h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.5rem, 2.2vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -0.05em;
    max-width: 14ch;
}

.auth-shell--single .auth-header h1 {
    max-width: 13ch;
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 58ch;
}

.auth-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.auth-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(23, 32, 51, 0.08);
    color: var(--auth-ink);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.auth-form-surface {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    margin-right: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--auth-ink);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(26, 35, 126, 0.72);
    font-size: 0.96rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
    padding: 0 14px 0 40px;
    border: 1px solid rgba(23, 32, 51, 0.12);
    border-radius: var(--auth-radius-md);
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%);
    color: var(--auth-ink);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-input::placeholder {
    color: #8C96A7;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(26, 35, 126, 0.38);
    box-shadow: 0 0 0 4px rgba(26, 35, 126, 0.08);
    background: #FFFFFF;
}

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

.auth-input.is-error {
    border-color: rgba(220, 38, 38, 0.44);
    background: #FFF7F7;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.auth-input.is-valid {
    border-color: rgba(21, 128, 61, 0.42);
    background: #F7FFF9;
    box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.08);
}

.auth-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #4A5875;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-toggle .material-icons {
    color: currentColor;
    opacity: 0.98;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle:hover,
.auth-toggle:focus-visible {
    background: rgba(26, 35, 126, 0.12);
    color: var(--auth-primary);
    outline: none;
}

.auth-button {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary) 0%, #2839A7 100%);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 2px;
    box-shadow: 0 18px 34px rgba(26, 35, 126, 0.24);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.auth-button:hover,
.auth-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 24px 44px rgba(26, 35, 126, 0.28);
    filter: saturate(1.04);
    outline: none;
}

.auth-button:disabled {
    cursor: wait;
    transform: none;
    opacity: 0.82;
    box-shadow: 0 12px 24px rgba(26, 35, 126, 0.16);
}

.auth-actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.auth-secondary-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
}

.auth-secondary-link:hover,
.auth-secondary-link:focus-visible {
    color: var(--auth-primary-deep);
    text-decoration: underline;
    outline: none;
}

.auth-caption {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.auth-inline-hint {
    margin: -2px 0 0;
    color: var(--auth-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 14px;
    background: var(--auth-danger-soft);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: var(--auth-danger);
    font-size: 0.84rem;
    line-height: 1.45;
}

.auth-error i {
    margin-top: 1px;
}

.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(23, 32, 51, 0.08);
}

.strength-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.strength-text {
    min-width: 84px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-media {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    padding: 0;
    background: #0f172a;
}

.auth-media-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-media-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-media-fallback {
    position: relative;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #111B63 0%, #1A237E 48%, #2B3EAE 100%);
}

.auth-media-fallback-logo {
    width: min(180px, 35%);
    height: auto;
    opacity: 0.9;
}

.toast1 {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30;
    width: min(360px, calc(100vw - 32px));
    border-radius: 18px;
    color: #FFFFFF;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
    animation: auth-toast-in 0.28s ease;
    overflow: hidden;
}

.toast1.toast-success {
    background: linear-gradient(135deg, #15803D 0%, #16A34A 100%);
}

.toast1.toast-danger {
    background: linear-gradient(135deg, #B91C1C 0%, #DC2626 100%);
}

.toast1.toast-warning {
    background: linear-gradient(135deg, #B45309 0%, #D97706 100%);
}

.toast1.toast-info {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
}

.toast-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.toast-icon .material-icons {
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.55;
}

.toast-close {
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.toast-close:hover,
.toast-close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
    outline: none;
}

@keyframes auth-toast-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

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

@media (max-width: 1366px) {
    .auth-page {
        padding: clamp(20px, 3vw, 36px);
    }

    .auth-shell {
        width: min(1140px, 100%);
        min-height: min(660px, calc(100vh - 64px));
        grid-template-columns: minmax(360px, 0.8fr) minmax(460px, 1.2fr);
    }

    .auth-panel {
        padding: 22px 24px 20px;
    }

    .auth-header h1 {
        font-size: clamp(1.42rem, 2vw, 1.92rem);
    }
}

@media (max-width: 1180px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    }

    .auth-panel {
        padding: 24px 22px;
    }

    .auth-media {
        padding: 0;
    }
}

@media (max-width: 980px) {
    .auth-page {
        padding: 10px;
    }

    .auth-shell,
    .auth-shell--single {
        width: min(720px, 100%);
        min-height: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-media {
        display: none;
    }

    .auth-panel {
        padding: 22px 16px 16px;
    }

    .auth-header h1 {
        max-width: 12ch;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 8px;
    }

    .auth-shell,
    .auth-shell--single {
        border-radius: 26px;
    }

    .auth-panel {
        padding: 16px 12px 12px;
        gap: 12px;
    }

    .auth-brand-mark {
        width: 54px;
        height: 54px;
        border-radius: 18px;
    }

    .auth-brand-logo {
        width: 38px;
        height: 38px;
    }

    .auth-header h1 {
        font-size: clamp(1.4rem, 8vw, 1.9rem);
        max-width: 14ch;
    }

    .auth-header p {
        font-size: 0.94rem;
        line-height: 1.7;
    }

    .auth-chip-list {
        gap: 8px;
    }

    .auth-chip {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .auth-input,
    .auth-button {
        min-height: 44px;
    }

    .auth-button {
        border-radius: 16px;
    }

    .toast1 {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 12px;
    }
}

@media (max-width: 420px) {
    .auth-page {
        padding: 0;
    }

    .auth-shell,
    .auth-shell--single {
        min-height: 100vh;
        border-radius: 0;
        border: 0;
        box-shadow: none;
    }

    .auth-panel {
        padding: 14px 10px 12px;
    }

    .auth-brand-copy small,
    .auth-caption {
        font-size: 0.84rem;
    }
}

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

@supports (padding: max(0px)) {
    .auth-page {
        padding-top: max(32px, env(safe-area-inset-top));
        padding-right: max(32px, env(safe-area-inset-right));
        padding-bottom: max(32px, env(safe-area-inset-bottom));
        padding-left: max(32px, env(safe-area-inset-left));
    }

    @media (max-width: 980px) {
        .auth-page {
            padding-top: max(20px, env(safe-area-inset-top));
            padding-right: max(20px, env(safe-area-inset-right));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
            padding-left: max(20px, env(safe-area-inset-left));
        }
    }

    @media (max-width: 420px) {
        .auth-page {
            padding-top: max(0px, env(safe-area-inset-top));
            padding-right: max(0px, env(safe-area-inset-right));
            padding-bottom: max(0px, env(safe-area-inset-bottom));
            padding-left: max(0px, env(safe-area-inset-left));
        }
    }
}
