:root {
    --bg: #07080b;
    --panel: #0e0f14;
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.14);
    --fg: #eef1f6;
    --muted: #9aa3b5;
    --dim: #626a7d;
    --accent: #ff2d4d;
    --discord: #5865F2;
    color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 'Inter', 'Segoe UI', Roboto, Arial, sans-serif; }
body.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0%, #1a0a0f, var(--bg) 60%) fixed, var(--bg); }
a { color: var(--fg); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; color: var(--fg); }
.mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #a4001a); box-shadow: 0 0 12px rgba(255, 45, 77, 0.45); }
.box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; }
.box .brand { margin-bottom: 22px; }
h1 { font-size: 21px; margin: 0 0 6px; }
h2 { font-size: 15px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
input { width: 100%; padding: 11px 12px; background: #0a0b0f; border: 1px solid var(--line-2); border-radius: 8px; color: var(--fg); font-size: 14px; }
input:focus { outline: none; border-color: var(--accent); }
input.code { font-size: 24px; letter-spacing: 8px; text-align: center; font-weight: 700; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 16px; }
label.check input { width: auto; margin-top: 3px; }
.hint { font-size: 12px; color: var(--dim); margin: 6px 0 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; margin-top: 20px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.discord { background: var(--discord); color: #fff; margin-top: 0; }
.btn.ghost { background: none; border-color: var(--line-2); color: var(--muted); width: auto; display: inline-flex; margin-top: 0; padding: 9px 14px; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 4px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.links { text-align: center; color: var(--dim); font-size: 13px; margin: 18px 0 0; }
.links a { color: var(--muted); }
.inline { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.msg.err { background: rgba(255, 45, 77, 0.12); border: 1px solid rgba(255, 45, 77, 0.4); color: #ffb3bf; }
.msg.ok { background: rgba(53, 217, 122, 0.1); border: 1px solid rgba(53, 217, 122, 0.35); color: #9ff0c2; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.foot { color: var(--dim); font-size: 12px; margin-top: 18px; }
.foot a { color: var(--dim); }

.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.top .spacer { flex: 1; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.wrap { max-width: 860px; margin: 0 auto; padding: 28px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.hello { display: flex; align-items: center; gap: 16px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #6b0b1d); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; object-fit: cover; flex-shrink: 0; }
.hello p { color: var(--muted); margin: 2px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-b { padding: 16px 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0; }
.facts dt { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
    .box { padding: 22px; }
    .top .tag { display: none; }
}

/* ---------- member area (stage 2) ---------- */
select, textarea { width: 100%; padding: 11px 12px; background: #0a0b0f; border: 1px solid var(--line-2); border-radius: 8px; color: var(--fg); font: inherit; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
select:focus, textarea:focus { outline: none; border-color: var(--accent); }
select:disabled { opacity: .5; }
label small { color: var(--dim); font-weight: 400; margin-left: 4px; }
.card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-h small { color: var(--dim); font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); margin: 0; }
.hello .pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap; }
.pill.red { background: rgba(255, 45, 77, 0.12); color: var(--accent); }
.pill.green { background: rgba(53, 217, 122, 0.12); color: #35d97a; }
.pill.yellow { background: rgba(255, 176, 0, 0.12); color: #ffb000; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.btn.small { width: auto; display: inline-flex; padding: 9px 16px; margin-top: 12px; }
form .btn.primary:not(.small) { width: auto; display: inline-flex; padding: 11px 22px; }
.inline-form { margin-top: 16px; }
.msg.warn { background: rgba(255, 176, 0, 0.08); border: 1px solid rgba(255, 176, 0, 0.35); color: #ffd27a; }
.msg small { opacity: .85; }
.wizard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.wz { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.wz.on { border-color: rgba(255, 45, 77, 0.4); background: rgba(255, 45, 77, 0.06); }
.wz small { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.wz b { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--dim); font-size: 12px; }
.team-list { display: grid; gap: 10px; }
.team-row { display: flex; align-items: center; gap: 12px; }
.team-row small { display: block; color: var(--muted); font-size: 12px; }
.tl-badge { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-layout { display: flex; gap: 24px; align-items: flex-start; }
.photo-col { width: 200px; flex-shrink: 0; }
.photo-prev { width: 200px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.1) 0 18%, transparent 19%), radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.07) 0 40%, transparent 41%), #12131a; display: flex; align-items: flex-end; justify-content: center; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-prev span { font-size: 12px; color: var(--dim); padding: 10px; }
.pending-photo { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.pending-photo img { width: 48px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; border: 1px dashed #ffb000; }
.pending-photo .pill { white-space: normal; }
.photo-col input[type=file] { padding: 8px; font-size: 12px; }
label.check span { color: var(--muted); }
label.check b { color: var(--fg); }
img.avatar { display: block; }
.logo-prev { width: 200px; aspect-ratio: 2 / 1; border-radius: 12px; border: 1px solid var(--line-2); background: #12131a; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-prev span { font-size: 13px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.pending-photo .logo-prev { width: 96px; padding: 4px; border: 1px dashed #ffb000; flex: none; }
.pending-photo .logo-prev img { width: auto; aspect-ratio: auto; border: 0; border-radius: 0; object-fit: contain; }
@media (max-width: 720px) {
    .profile-layout { flex-direction: column; }
    .photo-col { width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 14px; align-items: start; }
    .photo-col .photo-prev { width: 120px; grid-row: span 3; }
    .photo-col > .logo-prev { width: 120px; }
    .photo-col label { margin-top: 0; }
    .hello { flex-wrap: wrap; }
    .hello .pills { width: 100%; justify-content: flex-start; }
}
@media (max-width: 520px) {
    .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
    .wizard { grid-template-columns: minmax(0, 1fr); }
}
.wrap > .msg { margin-bottom: 0; }
