:root {
    --bg: #0a0f1f;
    --surface: #0f172b;
    --surface-2: #0b1224;
    --border: rgba(148, 163, 255, 0.25);
    --border-strong: rgba(226, 231, 255, 0.85);
    --text: #eef2ff;
    --text-muted: #a1accd;
    --primary: #6f82ff;
    --secondary: #5cc7ff;
    --danger: #f87171;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 18% 12%, rgba(108, 124, 255, 0.3), transparent 45%),
        radial-gradient(circle at 80% 8%, rgba(88, 196, 255, 0.22), transparent 46%),
        radial-gradient(circle at 80% 80%, rgba(40, 90, 200, 0.15), transparent 50%),
        var(--bg);
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-shell {
    width: min(520px, 92vw);
    padding: 28px;
}

.auth-card {
    width: 100%;
    background: linear-gradient(180deg, rgba(18, 26, 48, 0.95), rgba(14, 20, 38, 0.95));
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 30px;
    box-shadow: 0 26px 60px rgba(5, 8, 20, 0.55);
    display: grid;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
}

.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
}

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

.field {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.field input {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(162, 176, 210, 0.35);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(110, 130, 255, 0.22);
}

.field input::placeholder {
    color: rgba(161, 172, 205, 0.7);
}

.field input:-webkit-autofill {
    -webkit-text-fill-color: #0b1020;
    box-shadow: 0 0 0px 1000px #e9f0ff inset;
    border-color: rgba(200, 210, 255, 0.8);
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.btn {
    border: 1px solid var(--border);
    background: #0f1528;
    color: var(--text);
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #0b1020;
    border: none;
    box-shadow: 0 14px 26px rgba(96, 140, 255, 0.35);
}

.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(162, 176, 210, 0.35);
}

.btn.full {
    width: 100%;
}

.error {
    color: var(--danger);
    font-size: 12px;
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.auth-links {
    display: grid;
    gap: 10px;
}

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

.link {
    color: rgba(196, 206, 255, 0.95);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

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

.alert {
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
}

.alert.danger {
    border-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.10);
    color: rgba(255, 225, 225, 0.95);
}

.alert.success {
    border-color: rgba(92, 199, 255, 0.45);
    background: rgba(92, 199, 255, 0.10);
    color: rgba(217, 246, 255, 0.95);
}

.note-block {
    border: 1px solid var(--border);
    background: rgba(11, 18, 36, 0.55);
    border-radius: 18px;
    padding: 14px 14px;
    display: grid;
    gap: 6px;
}

.note-title {
    font-weight: 700;
    font-size: 13px;
}

.note-text {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

.field textarea {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(162, 176, 210, 0.35);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
    min-height: 120px;
}

.field textarea:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(110, 130, 255, 0.22);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-meta {
    display: flex;
    justify-content: flex-start;
    margin-top: -6px;
}

.auth-meta.auth-meta-bottom {
    justify-content: flex-end;
    margin-top: 18px;
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.locale-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(210, 220, 255, 0.9);
}

.locale-menu {
    position: relative;
}

.locale-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(162, 176, 210, 0.35);
    background: rgba(15, 18, 40, 0.55);
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.locale-summary::-webkit-details-marker {
    display: none;
}

.locale-menu[open] .locale-summary {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(110, 130, 255, 0.22);
}

.locale-current {
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.locale-flag {
    width: 18px;
    height: 12px;
    border-radius: 4px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.locale-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.75;
}

.locale-options {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(162, 176, 210, 0.35);
    background: rgba(12, 14, 32, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 50;
}

.locale-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-weight: 700;
}

.locale-option:hover {
    border-color: rgba(162, 176, 210, 0.35);
    background: rgba(35, 45, 85, 0.4);
}

.locale-option.is-active {
    border-color: rgba(162, 176, 210, 0.5);
    background: rgba(45, 60, 120, 0.5);
}

.locale-option-label {
    flex: 1;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.locale-check {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.locale-option:focus-visible,
.locale-summary:focus-visible {
    outline: none;
    border-color: rgba(155, 172, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(110, 130, 255, 0.22);
}
