:root {
    --bg: #070813;
    --card: #0e1020;
    --field: #111427;
    --line: #393259;
    --line-soft: #27233f;
    --text: #f7f5ff;
    --muted: #a7a2bd;
    --accent: #a370f7;
    --accent-strong: #c49eff;
    --accent-dark: #261b4f;
    --danger: #fb7185;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background-image: linear-gradient(rgba(163, 112, 247, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(163, 112, 247, .045) 1px, transparent 1px), radial-gradient(ellipse 34rem 22rem at 12% 12%, rgba(163, 112, 247, .18) 0, transparent 72%), radial-gradient(ellipse 30rem 24rem at 88% 76%, rgba(34, 211, 238, .09) 0, transparent 72%); background-size: 28px 28px, 28px 28px, auto, auto; background-color: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-shell { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(526px, 100%); margin: 0 auto; }
.login-card { max-width: 526px; }
.register-card { max-width: 606px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { margin: 14px 0 4px; font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -.035em; }
.auth-header p { margin: 0; color: var(--muted); font-size: 15px; }
.site-avatar { display: grid; place-items: center; width: 66px; height: 66px; padding: 4px; margin: 0 auto; border: 1px solid #7259b3; border-radius: 19px; background: #16132b; box-shadow: 0 0 30px rgba(163, 112, 247, .25); overflow: hidden; }
.site-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.site-avatar.small { width: 34px; height: 34px; padding: 2px; margin: 0; border-radius: 10px; }
.site-avatar.large { width: 54px; height: 54px; margin: 0; border-radius: 16px; }
.auth-card form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; min-width: 0; color: #cfc7c3; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
label em { color: var(--accent); font-style: normal; }
.field-control { display: flex; align-items: center; gap: 11px; min-height: 56px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, #1b1918, var(--field)); color: #a9a29e; transition: border-color .2s, box-shadow .2s; }
.field-control:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(163, 112, 247, .16); }
.field-control > span { width: 18px; text-align: center; color: #aaa29e; font-size: 18px; }
.field-control input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0; background: transparent; color: var(--text); }
.field-control input::placeholder { color: #938b87; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.label-row > span { min-width: 0; }
.generate-password { flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--accent-strong); font-size: 12px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; cursor: pointer; }
.generate-password:hover { text-decoration: underline; }
.password-toggle { flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #aaa29e; font-size: 17px; line-height: 1; cursor: pointer; }
.password-toggle:hover { color: var(--accent); }
.forgot-link { width: fit-content; margin: -7px 0 0 auto; color: #bcb2ad; font-size: 13px; }
.forgot-link:hover, .switch-link a:hover { color: var(--accent); }
.submit-button { min-height: 56px; border: 0; border-radius: 13px; background: linear-gradient(100deg, #8f63e8, var(--accent-strong)); color: #160d2a; font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(163, 112, 247, .25); }
.submit-button:hover { filter: brightness(1.08); }
.divider { display: flex; align-items: center; gap: 14px; margin: 25px 0 18px; color: #938b87; text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 13px; background: transparent; color: #ddd4cf; cursor: default; }
.google-g { color: #4285f4; font-size: 21px; font-weight: 800; }
.switch-link { margin: 24px 0 0; text-align: center; color: var(--muted); }
.switch-link a { color: #d6cbc5; }
.error { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #853c48; border-radius: 10px; background: #421d25; color: #ffd9dd; }
.form-section { padding: 23px; border: 1px solid var(--line-soft); border-radius: 15px; background: #100f0e; }
.form-section h2 { margin: 0; font-size: 18px; }
.section-note { margin: 3px 0 20px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 16px; }

@media (max-width: 1024px) {
    .register-card .form-grid { grid-template-columns: 1fr; }
}

.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line-soft); background: #0d0b0a; }
.brand-link { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; }
.user { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.user a { color: var(--accent); }
.dashboard { max-width: 1100px; margin: 0 auto; padding: 64px 36px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.dashboard h1 { margin: 9px 0 25px; font-size: 36px; }
.welcome-card { display: flex; align-items: center; gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #191512, #100e0d); }
.welcome-card h2 { margin: 0 0 5px; }
.welcome-card p { margin: 0; color: var(--muted); }

@media (max-width: 640px) {
    .auth-shell { padding: 24px 16px; }
    .auth-card { width: min(100%, 526px); }
    .auth-header { margin-bottom: 24px; }
    .auth-header h1 { font-size: 30px; }
    .form-grid { grid-template-columns: 1fr; gap: 15px; }
    .form-section { padding: 18px 15px; }
    .topbar { padding: 0 16px; }
    .user span { display: none; }
    .dashboard { padding: 40px 20px; }
    .dashboard h1 { font-size: 30px; }
    .welcome-card { align-items: flex-start; flex-direction: column; }
}
