/* Mirai brand: Sky Blue #5CC8FF → Lavender #B49CFF → Sakura Pink #FF7EB6, Deep Indigo #1A1F3D, Moonlight #E6EFFF */
:root {
  --sky: #5CC8FF; --lav: #B49CFF; --sakura: #FF7EB6; --indigo: #1A1F3D; --moon: #E6EFFF;
  --grad: linear-gradient(100deg, var(--sky), var(--lav) 55%, var(--sakura));
  --bg: #eef3ff; --surface: #fff; --text: #1A1F3D; --muted: #4c5275; --line: #c3c8de; --line-soft: #e2e6f3;
  --primary: #4b55c9; --primary-text: #fff; --primary-soft: #e3e3ff; --danger: #c0264f; --hover: rgba(75, 85, 201, .08);
  --radius: 28px; --font-head: Montserrat, "Segoe UI", Helvetica, Arial, sans-serif;
  font-family: "Zen Maru Gothic", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12162e; --surface: #1A1F3D; --text: #E6EFFF; --muted: #aab3d6; --line: #4a5180; --line-soft: #2b3260;
    --primary: #8fd6ff; --primary-text: #1A1F3D; --primary-soft: #33306b; --danger: #ff9bb8; --hover: rgba(143, 214, 255, .08); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); } .center { text-align: center; }

/* ---------- buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 24px; border-radius: 20px;
  border: 0; background: var(--grad); color: var(--indigo); font: 600 14px/1 inherit; font-family: var(--font-head); letter-spacing: .02em; cursor: pointer; }
.btn:hover { filter: brightness(1.06) saturate(1.1); box-shadow: 0 2px 12px rgba(180, 156, 255, .45); }
.btn.text { background: none; color: var(--primary); padding: 0 12px; }
.btn.text:hover { background: var(--hover); box-shadow: none; filter: none; }
.btn.outline { background: none; color: var(--primary); border: 1px solid var(--line); }
.btn.outline:hover { background: var(--hover); box-shadow: none; filter: none; }
.btn.danger { color: var(--danger); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.field { position: relative; margin: 14px 0 4px; flex: 1; }
.field input { width: 100%; height: 56px; padding: 18px 16px 6px; border: 1px solid var(--line); border-radius: 4px; background: transparent;
  color: var(--text); font: 16px inherit; font-family: inherit; outline: none; }
.field input:focus { border: 2px solid var(--primary); padding-left: 15px; }
.field label { position: absolute; left: 12px; top: 17px; padding: 0 4px; color: var(--muted); font-size: 16px; pointer-events: none;
  background: var(--surface); transition: all .15s; }
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field input[type=date] + label { top: -8px; font-size: 12px; }
.field input:focus + label { color: var(--primary); }
.field.invalid input { border-color: var(--danger); }
.field.invalid label { color: var(--danger); }
.err { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: 12px; margin-top: 6px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.label { font-size: 14px; margin: 0 0 4px; }
.row2 { display: flex; gap: 16px; }
.suffix-field { display: flex; align-items: center; gap: 8px; }
.suffix { color: var(--muted); font-size: 15px; margin-top: 10px; white-space: nowrap; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 14px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 8px; }
.actions.end { justify-content: flex-end; margin-top: 16px; }

/* ---------- sign-in card */
body.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.card { width: 100%; max-width: 1040px; display: flex; gap: 32px; background: var(--surface); border-radius: var(--radius); padding: 36px 40px 32px; }
.card-left { flex: 1; } .card-right { flex: 1; padding-top: 72px; }
.card h1 { font-size: 36px; font-weight: 400; margin: 20px 0 14px; line-height: 1.2; }
.card .sub { font-size: 16px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 3px 12px 3px 3px; font-size: 14px; }
.chip img { width: 22px; height: 22px; border-radius: 50%; }
.perms { padding-left: 20px; line-height: 2; }
.account-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 8px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.account-row:hover { background: var(--hover); }
.account-row img, .account-row .plus { width: 36px; height: 36px; border-radius: 50%; }
.account-row .plus { display: grid; place-items: center; font-size: 22px; color: var(--muted); }
.account-row span { display: flex; flex-direction: column; } .account-row small { color: var(--muted); }
.auth-foot { width: 100%; max-width: 1040px; display: flex; gap: 24px; justify-content: flex-end; font-size: 12px; color: var(--muted); padding: 16px 24px; }
.auth-foot span:first-child { margin-right: auto; }
@media (max-width: 840px) {
  .card { flex-direction: column; gap: 0; padding: 24px; } .card-right { padding-top: 16px; } .card h1 { font-size: 28px; }
  .row2 { flex-direction: column; gap: 0; } body.auth { justify-content: flex-start; }
}

/* ---------- My Account */
body.acct { background: var(--surface); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 22px; }
.logo b { color: var(--text); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 8px; }
.pop { position: relative; }
.pop summary { list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; fill: var(--muted); }
.pop summary::-webkit-details-marker { display: none; }
.pop summary:hover { background: var(--hover); }
.pop-body { position: absolute; right: 0; top: 48px; background: var(--bg); border-radius: 28px; padding: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.18); min-width: 300px; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface); }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; color: var(--text); font-size: 13px; text-align: center; }
.app:hover { background: var(--hover); } .app img, .app-ph { width: 40px; height: 40px; border-radius: 10px; }
.app-ph { display: grid; place-items: center; background: var(--primary-soft); color: var(--text); font-weight: 600; font-size: 18px; }
.acct-menu { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 360px; }
.acct-menu .em { font-size: 14px; } .acct-menu .hi { font-size: 22px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }
.avatar.big { width: 80px; height: 80px; } .avatar.huge { width: 96px; height: 96px; }
.layout { display: flex; max-width: 1200px; margin: 0 auto; }
.side { width: 290px; padding: 8px 0; flex-shrink: 0; position: sticky; top: 64px; align-self: flex-start; }
.side a { display: flex; align-items: center; gap: 22px; height: 56px; padding: 0 24px; margin-right: 16px; border-radius: 0 28px 28px 0;
  color: var(--text); font-size: 14px; font-weight: 500; fill: var(--muted); }
.side a:hover { background: var(--hover); }
.side a.active { background: var(--primary-soft); color: var(--text); fill: var(--text); }
.content { flex: 1; padding: 24px 32px 64px; min-width: 0; }
.hero { text-align: center; padding: 24px 0 12px; } .hero img { margin: 0 auto; } .hero h1 { font-weight: 400; font-size: 28px; margin: 16px 0 8px; }
.page-h { text-align: center; font-weight: 400; font-size: 28px; margin: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.tile, .panel { display: block; border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px 24px; color: var(--text); background: var(--surface); }
.tile:hover { box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.tile h3 { margin: 0 0 8px; font-weight: 400; font-size: 20px; } .tile p { color: var(--muted); font-size: 14px; }
.tile .go { color: var(--primary); font-size: 14px; font-weight: 500; }
.panel { margin-top: 20px; } .panel h2 { margin: 0 0 8px; font-size: 20px; font-weight: 400; }
.avatar-form { display: flex; align-items: center; gap: 24px; }
.kv { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.list { list-style: none; padding: 0; margin: 8px 0 16px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.list li small { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }
.app-line { display: flex; gap: 14px; align-items: center; } .app-line img { width: 36px; height: 36px; border-radius: 8px; }
.pill { font-size: 11px; background: var(--primary-soft); padding: 2px 8px; border-radius: 10px; margin-left: 6px; font-weight: 500; }
.flash { background: var(--primary-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; font-size: 14px; }
@media (max-width: 900px) {
  .side { display: none; } .content { padding: 16px; } .acct-menu { width: 300px; } .avatar-form { flex-direction: column; text-align: center; }
  .logo span { font-size: 18px; }
}

/* ---------- v2: security, 2-Step Verification, recovery */
.factor { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 4px; fill: var(--primary); }
.pill.ok { background: #c4eed0; color: #0d652d; } .pill.warn { background: #ffe1a8; color: #7a4a00; }
@media (prefers-color-scheme: dark) { .pill.ok { background: #0f5223; color: #c4eed0; } .pill.warn { background: #5c3c00; color: #ffdf99; } }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.ok { background: #1e8e3e; } .dot.warn { background: #f9ab00; }
.srows { margin-top: 8px; }
.srow { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-top: 1px solid var(--line-soft); color: var(--text); fill: var(--muted); }
.srow:hover { background: var(--hover); }
.srow .sicon { width: 24px; } .srow .stitle { width: 200px; font-size: 14px; }
.srow .sval { flex: 1; font-size: 14px; color: var(--muted); }
.checkup { border-width: 0; } .checkup.good { background: #e6f4ea; } .checkup.warn { background: #fef7e0; }
@media (prefers-color-scheme: dark) { .checkup.good { background: #0d2b17; } .checkup.warn { background: #3a2c05; } }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; font: 500 18px/1.6 ui-monospace, Consolas, monospace; padding-left: 24px; margin: 20px 0; }
.qr-row { display: flex; gap: 28px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line-soft); width: 216px; height: 216px; }
.qr svg { width: 200px; height: 200px; display: block; }
.key { display: inline-block; font: 500 16px ui-monospace, Consolas, monospace; letter-spacing: 1px; background: var(--bg); padding: 10px 14px; border-radius: 8px; }
.steps { line-height: 2; font-size: 14px; padding-left: 20px; }
.btn.danger-fill { background: var(--danger); color: #fff; }
@media print { .topbar, .side, .actions { display: none !important; } }

/* ---------- v3: passkeys, phone, app passwords */
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 24px 0 16px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
.btn.wide { width: 100%; height: 44px; }
.method { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.method .micon { fill: var(--muted); width: 28px; }
.method .mtext { flex: 1; min-width: 200px; } .method .mtext small { display: block; color: var(--muted); margin-top: 2px; }
form.inline { display: flex; align-items: center; gap: 8px; }
input.mini { height: 36px; width: 140px; padding: 0 10px; border: 1px solid var(--line); border-radius: 18px; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.hero2 { background: var(--bg); border: 0; }

/* ---------- Mirai brand layer */
h1, h2, h3, .page-h, .tile h3 { font-family: var(--font-head); letter-spacing: -.01em; }
.mark { display: block; flex-shrink: 0; }
.wm { font-family: var(--font-head); font-weight: 400; text-transform: uppercase; letter-spacing: .32em; }
.wm-sub { font-family: var(--font-head); font-weight: 300; margin-left: .1em; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .wm { font-size: 26px; color: #F5F7FF; }
.wm-kanji { display: inline-block; margin-left: -.1em; font: 500 13px/1.05 "Zen Maru Gothic", sans-serif; color: var(--lav);
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* sign-in: art panel on the left, form on the right */
body.auth { background: radial-gradient(ellipse at 20% 0%, rgba(180,156,255,.25), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(255,126,182,.18), transparent 50%), var(--bg); }
.card { padding: 0; overflow: hidden; box-shadow: 0 10px 40px rgba(26, 31, 61, .18); border: 1px solid var(--line-soft); }
.card-left { position: relative; padding: 36px 40px; min-height: 420px; color: #F5F7FF;
  background: linear-gradient(180deg, rgba(26,31,61,.2) 0%, rgba(26,31,61,.35) 45%, rgba(26,31,61,.92) 100%), url(/static/brand/torii-scene.jpg) center / cover; }
.card-left h1 { margin-top: 170px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.card-left .sub { color: #dfe6ff; } .card-left .sub b { color: #fff; }
.card-left .chip { border-color: rgba(230,239,255,.5); color: #fff; background: rgba(26,31,61,.45); }
.card-right { padding: 108px 40px 32px 8px; }
.field input:focus { border-color: var(--lav); }
.field input:focus + label { color: var(--primary); }
.auth-foot span:first-child { font-family: var(--font-head); letter-spacing: .08em; }
@media (max-width: 840px) {
  .card { padding: 0; } .card-left { min-height: 0; padding: 24px; }
  .card-left h1 { margin-top: 56px; } .card-right { padding: 16px 24px 24px; }
}

/* My Account */
.topbar { backdrop-filter: blur(8px); }
.logo { gap: 12px; color: var(--text); font-size: 20px; }
.logo .wm { font-size: 19px; letter-spacing: .28em; }
.logo .wm-sub { color: var(--muted); font-size: 19px; }
.side a.active { background: linear-gradient(100deg, rgba(92,200,255,.22), rgba(180,156,255,.26) 55%, rgba(255,126,182,.22)); }
.hero { position: relative; padding-top: 0; }
.hero-art { height: 170px; margin: 0 0 -48px; border-radius: 24px;
  background: linear-gradient(180deg, transparent 40%, rgba(26,31,61,.35)), url(/static/brand/girl.jpg) 30% 35% / cover; }
.hero .avatar.huge { position: relative; border: 4px solid var(--surface); box-sizing: content-box; }
.tile:hover { box-shadow: 0 2px 14px rgba(180, 156, 255, .3); border-color: transparent; }
.flash { background: linear-gradient(100deg, rgba(92,200,255,.18), rgba(255,126,182,.18)); }
.btn.outline, .btn.text { font-family: var(--font-head); }
.btn.danger-fill { background: var(--danger); color: #fff; }
@media (max-width: 900px) { .logo .wm-sub { display: none; } .hero-art { height: 120px; } }
