:root {
  color-scheme: dark;
  --bg: #05050a;
  --panel: rgba(14, 15, 28, .76);
  --panel-strong: rgba(12, 13, 24, .92);
  --line: rgba(255,255,255,.10);
  --text: #f7f7ff;
  --muted: #9ca0b7;
  --violet: #7b2cff;
  --magenta: #e732ff;
  --cyan: #23d5ff;
  --blue: #157bff;
  --success: #62e6b5;
  --danger: #ff7896;
  --shadow: 0 34px 90px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background:
  radial-gradient(circle at 12% 8%, rgba(111, 41, 255, .17), transparent 34rem),
  radial-gradient(circle at 84% 90%, rgba(15, 182, 255, .13), transparent 30rem),
  linear-gradient(145deg, #030308 0%, #080812 55%, #04040a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .32; background-image: linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.aurora { position: fixed; width: 32rem; height: 32rem; border-radius: 50%; filter: blur(110px); opacity: .17; pointer-events: none; }
.aurora-a { top: -16rem; left: 23%; background: #932eff; }
.aurora-b { right: -15rem; bottom: -16rem; background: #00c8ff; }
.glass-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.eyebrow { color: #b7aaff; letter-spacing: .18em; font-size: .72rem; font-weight: 800; }
.alert { padding: .9rem 1rem; border-radius: 14px; margin: 1rem 0; font-size: .9rem; }
.alert-success { color: #bfffe4; border: 1px solid rgba(98,230,181,.30); background: rgba(98,230,181,.10); }
.alert-error { color: #ffc2cf; border: 1px solid rgba(255,120,150,.30); background: rgba(255,120,150,.10); }

/* Connexion */
.auth-shell { position: relative; z-index: 1; min-height: 100vh; width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 50px 0; display: grid; grid-template-columns: 1.15fr .75fr; gap: 5rem; align-items: center; }
.brand-panel { padding: 2rem 0; }
.brand-lockup { display: flex; gap: 1.6rem; align-items: center; }
.brand-logo { width: clamp(118px, 13vw, 180px); filter: drop-shadow(0 0 32px rgba(86,85,255,.48)); }
.brand-panel h1 { margin: .55rem 0 0; font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-size: clamp(2.8rem, 5vw, 5.9rem); line-height: .94; letter-spacing: -.065em; }
.brand-panel .lead { max-width: 720px; margin: 2.2rem 0; color: #b7bacb; line-height: 1.8; font-size: 1.05rem; }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.feature-row article { padding: 1rem; border-left: 1px solid rgba(255,255,255,.13); }
.feature-row strong, .feature-row span { display: block; }
.feature-row strong { margin-bottom: .45rem; font-size: .9rem; }
.feature-row span { color: var(--muted); font-size: .77rem; line-height: 1.5; }
.auth-card { border-radius: 28px; padding: 2rem; }
.status-pill { display: inline-flex; align-items: center; gap: .55rem; color: #c3c4d4; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 999px; padding: .5rem .72rem; font-size: .72rem; }
.status-pill span { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 12px var(--success); }
.auth-card h2 { margin: 2rem 0 .7rem; font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-size: 2rem; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 1.8rem; color: var(--muted); line-height: 1.65; font-size: .92rem; }
.oauth-button { display: flex; align-items: center; gap: .8rem; width: 100%; border-radius: 16px; padding: .75rem .9rem; color: #10101a; background: #fff; font-weight: 750; transition: transform .2s, box-shadow .2s; }
.oauth-button:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(49,147,255,.22); }
.oauth-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #080811; }
.oauth-icon img { width: 30px; height: 30px; object-fit: contain; }
.oauth-button > span:nth-child(2) { flex: 1; text-align: left; }
.oauth-button svg { width: 21px; }
.auth-note { display: flex; gap: .8rem; margin: 1.3rem 0; color: #9094aa; font-size: .76rem; line-height: 1.5; }
.auth-note svg { width: 22px; min-width: 22px; color: #7f9cff; }
.auth-card footer { border-top: 1px solid var(--line); padding-top: 1.1rem; color: #6e7187; text-align: center; font-size: .7rem; }

/* Dashboard */
.topbar { position: relative; z-index: 10; width: min(1440px, calc(100% - 48px)); height: 88px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); }
.mini-brand { display: flex; align-items: center; gap: .8rem; }
.mini-brand img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(63,96,255,.34)); }
.mini-brand span { display: flex; flex-direction: column; }
.mini-brand strong { font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; letter-spacing: .02em; }
.mini-brand small { color: var(--muted); letter-spacing: .12em; font-size: .58rem; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.connected-dot { display: inline-flex; align-items: center; gap: .45rem; color: #b9bfce; font-size: .76rem; }
.connected-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }
.quiet-link { padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 12px; color: #c8cad8; font-size: .78rem; }
.dashboard-shell { position: relative; z-index: 1; width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 2rem; align-items: start; }
.profile-summary { position: sticky; top: 24px; border-radius: 28px; padding: 2rem; text-align: center; }
.avatar-ring { width: 154px; height: 154px; margin: 0 auto 1.8rem; padding: 3px; border-radius: 42px; background: linear-gradient(135deg, var(--magenta), var(--violet), var(--cyan)); box-shadow: 0 20px 50px rgba(43,70,255,.20); }
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; border: 7px solid #0b0c16; border-radius: 39px; background: #080812; }
.profile-summary h1 { margin: .45rem 0 .55rem; font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-size: 2rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.copy-id { margin: 0 auto; display: inline-flex; align-items: center; gap: .45rem; color: #aeb1c3; background: none; border: 0; cursor: pointer; }
.copy-id svg { width: 16px; }
.copy-id.copied { color: var(--success); }
.summary-bio { min-height: 3em; margin: 1.4rem 0; color: var(--muted); line-height: 1.65; font-size: .84rem; }
.identity-badge { display: flex; gap: .8rem; align-items: center; padding: .8rem; border: 1px solid rgba(94,118,255,.18); background: rgba(67,79,255,.07); border-radius: 16px; text-align: left; }
.identity-badge img { width: 34px; height: 34px; object-fit: contain; }
.identity-badge div { display: flex; flex-direction: column; gap: .2rem; }
.identity-badge strong { font-size: .75rem; }
.identity-badge span { color: var(--muted); font-size: .67rem; }
.profile-workspace { min-width: 0; }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.4rem; }
.workspace-heading h2 { margin: .35rem 0 0; font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.055em; }
.save-indicator { color: #7e8298; font-size: .72rem; text-align: right; }
.save-indicator.is-dirty { color: #ffc56f; }
.profile-form, .source-card { border-radius: 26px; padding: 2rem; margin-bottom: 1.4rem; }
.section-title { display: flex; gap: 1rem; align-items: flex-start; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.section-title > span { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid rgba(140,110,255,.25); border-radius: 11px; color: #baaaff; background: rgba(117,54,255,.10); font-size: .72rem; font-weight: 800; }
.section-title h3 { margin: .05rem 0 .25rem; font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-size: 1.15rem; }
.section-title p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .6rem; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: #d8d9e5; font-size: .78rem; font-weight: 650; }
.field input, .field textarea, .input-prefix { width: 100%; color: var(--text); border: 1px solid rgba(255,255,255,.10); background: rgba(4,5,12,.55); border-radius: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input, .field textarea { padding: .9rem 1rem; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .input-prefix:focus-within { border-color: rgba(88,151,255,.65); box-shadow: 0 0 0 4px rgba(42,111,255,.11); }
.field small { color: #74788e; font-size: .67rem; line-height: 1.45; }
.input-prefix { display: flex; align-items: center; }
.input-prefix b { color: #74788e; padding-left: 1rem; }
.input-prefix input { border: 0; background: transparent; box-shadow: none !important; padding-left: .35rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .8rem; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.primary-button, .secondary-button { border-radius: 13px; padding: .85rem 1.05rem; cursor: pointer; }
.secondary-button { color: #c2c4d2; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.primary-button { display: flex; align-items: center; gap: .8rem; border: 0; color: #fff; background: linear-gradient(120deg, #7e2eff, #176fff 65%, #12b9e7); box-shadow: 0 12px 30px rgba(46,79,255,.22); font-weight: 750; }
.primary-button svg { width: 19px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-top: 1.4rem; }
.source-grid div { padding: 1rem; border: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.16); border-radius: 14px; }
.source-grid span, .source-grid strong { display: block; overflow-wrap: anywhere; }
.source-grid span { color: #777b91; font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.source-grid strong { margin-top: .35rem; font-size: .82rem; font-weight: 600; }
.detached-note { display: flex; gap: .9rem; align-items: flex-start; margin-top: 1.2rem; padding: 1rem; border: 1px solid rgba(36,204,255,.15); border-radius: 15px; background: rgba(27,159,255,.06); }
.detached-note svg { width: 23px; min-width: 23px; color: #53cfff; }
.detached-note p { margin: 0; color: #9da5b8; font-size: .76rem; line-height: 1.55; }
.detached-note strong { color: #d7f7ff; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; gap: 1rem; padding: 30px 0; }
  .brand-panel { padding-bottom: 0; }
  .brand-panel h1 { font-size: clamp(2.8rem, 11vw, 5rem); }
  .auth-card { max-width: 620px; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .profile-summary { position: static; display: grid; grid-template-columns: auto 1fr; text-align: left; column-gap: 1.2rem; }
  .avatar-ring { grid-row: 1 / 6; width: 120px; height: 120px; margin: 0; border-radius: 34px; }
  .avatar-ring img { border-radius: 31px; }
  .identity-badge { margin-top: .5rem; }
}

@media (max-width: 680px) {
  .auth-shell, .dashboard-shell, .topbar { width: min(100% - 24px, 1440px); }
  .brand-lockup { align-items: flex-start; gap: .5rem; }
  .brand-logo { width: 88px; }
  .brand-panel h1 { font-size: 2.65rem; }
  .feature-row { grid-template-columns: 1fr; }
  .auth-card, .profile-form, .source-card, .profile-summary { padding: 1.25rem; border-radius: 20px; }
  .topbar { height: 74px; }
  .connected-dot { display: none; }
  .dashboard-shell { padding-top: 24px; }
  .profile-summary { display: block; text-align: center; }
  .avatar-ring { margin: 0 auto 1.3rem; }
  .workspace-heading { display: block; }
  .save-indicator { display: block; text-align: left; margin-top: .7rem; }
  .form-grid, .source-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .primary-button, .secondary-button { width: 100%; justify-content: center; }
}


/* PRISM ID — comptes indépendants */
.auth-actions { display: grid; gap: .85rem; }
.create-id-button {
  color: #fff;
  background: linear-gradient(120deg, #7e2eff, #176fff 65%, #12b9e7);
  box-shadow: 0 14px 34px rgba(46,79,255,.24);
}
.create-id-button .oauth-icon { background: rgba(5,5,13,.78); }
.prism-login-button { margin-top: 0; }
.account-switch { margin: 1rem 0 0 !important; text-align: center; color: #85899e !important; font-size: .76rem !important; }
.account-switch a { color: #c9bdff; font-weight: 750; }
.account-switch a:hover { text-decoration: underline; }

.local-account-page { overflow-y: auto; }
.local-auth-shell {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 38px 0;
  display: grid;
  place-items: center;
}
.local-auth-card {
  width: 100%;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border-radius: 28px;
}
.local-auth-card-small { max-width: 620px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #aeb1c3;
  font-size: .78rem;
  margin-bottom: 1.8rem;
}
.back-link svg { width: 18px; }
.local-auth-heading {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
  margin-bottom: 1.4rem;
}
.local-auth-heading > img {
  width: 116px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(86,85,255,.42));
}
.local-auth-heading h1 {
  margin: .45rem 0 .7rem;
  font-family: 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.3rem);
  line-height: .96;
  letter-spacing: -.055em;
}
.local-auth-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: .9rem;
}
.local-auth-heading.compact { grid-template-columns: 92px minmax(0,1fr); }
.local-auth-heading.compact > img { width: 92px; height: 92px; }
.local-auth-heading.compact h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.local-auth-form { margin-top: 1.25rem; }
.local-form-grid { margin-top: 0; }
.local-form-grid.one-column { grid-template-columns: 1fr; }
.consent-line {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 1.2rem 0;
  color: #aeb1c3;
  font-size: .76rem;
  line-height: 1.45;
}
.consent-line input { margin-top: .16rem; accent-color: #7e5cff; }
.local-submit { width: 100%; justify-content: center; border: 0; }
.local-submit span { flex: 1; text-align: left; }
.local-submit svg { margin-left: auto; }

@media (max-width: 680px) {
  .local-auth-shell { width: min(100% - 20px, 860px); padding: 18px 0; }
  .local-auth-card { padding: 1.15rem; border-radius: 20px; }
  .local-auth-heading, .local-auth-heading.compact {
    grid-template-columns: 74px minmax(0,1fr);
    gap: .8rem;
  }
  .local-auth-heading > img, .local-auth-heading.compact > img { width: 74px; height: 74px; }
  .local-auth-heading h1 { font-size: 2rem; }
  .local-auth-heading p { font-size: .8rem; }
}

/* PRISM ID — bouton de connexion locale */
.password-login-button {
    color: #f4f5ff;
    background: rgba(18, 20, 34, .94);
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.password-login-button:hover {
    transform: translateY(-1px);
    background: rgba(25, 28, 46, .98);
    border-color: rgba(141, 115, 255, .36);
}

.password-login-icon {
    color: #c9bbff;
    background: linear-gradient(145deg, rgba(123, 67, 255, .24), rgba(32, 148, 255, .18));
}

.password-login-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* PRISM ID — finalisation des identifiants après connexion PRISM */
.credentials-card {
  max-width: 760px;
}
.credentials-card .local-auth-heading {
  grid-template-columns: 96px minmax(0, 1fr);
}
.credentials-card .local-auth-heading > img {
  width: 96px;
  height: 96px;
}
.credentials-card .local-auth-heading h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}
.credentials-linked-note {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 1.25rem 0;
  padding: .95rem 1rem;
  border: 1px solid rgba(138, 105, 255, .24);
  border-radius: 16px;
  background: rgba(104, 66, 255, .09);
}
.credentials-linked-note strong { color: #fff; }
.credentials-linked-note span { color: var(--muted); font-size: .82rem; }
.credentials-help {
  margin: 1rem 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}
@media (max-width: 640px) {
  .credentials-card .local-auth-heading { grid-template-columns: 72px minmax(0,1fr); }
  .credentials-card .local-auth-heading > img { width: 72px; height: 72px; }
  .credentials-linked-note { align-items: flex-start; flex-direction: column; }
}

/* PRISM ID v2 — THRONESHARD legacy claim */
.legacy-claim-banner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 24px;margin-bottom:18px}.legacy-claim-banner h3{margin:4px 0 6px}.legacy-claim-banner p{margin:0;color:var(--muted,#a8a9b8);line-height:1.5}.legacy-claim-banner .primary-button{flex:0 0 auto;text-decoration:none}.claim-shell{grid-template-columns:1fr;max-width:960px}.claim-workspace{width:100%}.claim-card{padding:26px}.claim-steps{display:grid;gap:10px;margin:0 0 24px;padding-left:24px;color:var(--muted,#a8a9b8);line-height:1.55}.claim-privacy{display:grid;gap:4px;margin-top:22px;padding:16px 18px;border-radius:14px;background:rgba(92,105,255,.08);border:1px solid rgba(130,138,255,.18)}.claim-privacy span{color:var(--muted,#a8a9b8);line-height:1.5}@media(max-width:760px){.legacy-claim-banner{align-items:flex-start;flex-direction:column}.legacy-claim-banner .primary-button{width:100%}}
