/* =========================================================
   Clipio — auth pages + account settings
   ---------------------------------------------------------
   Layers on css/site.css (tokens, the dark nav, pill buttons,
   the dark footer) and css/pages.css (page base, the masthead,
   the 52px title style), so these pages look like the rest of
   the site: the nav's black runs into blue and fades
   to white, with a soft white card sitting on it.
   ========================================================= */

/* ---------------- shared shell ----------------
   The masthead band from css/pages.css, with the card in it
   instead of a title. The band is taller than the card needs,
   so the card's lower half lands on the white tail. */

.auth{
  position:relative; overflow:hidden;
  padding:64px 0 120px;
  background:linear-gradient(180deg, #08080B 0%, #0A0D1C 22%, #0B1A55 42%, #0F3FD6 60%, #5C8CFF 74%, #E4ECFF 88%, #FFFFFF 100%);
}
.auth::before{
  content:''; position:absolute; left:50%; top:30%; width:min(1000px, 100%); height:420px; transform:translateX(-50%); pointer-events:none;
  background:radial-gradient(closest-side, rgba(58,110,255,.45), transparent);
}
.auth > *{ position:relative; }

.auth__card{
  width:100%; max-width:440px; margin-inline:auto;
  background:#fff; border-radius:28px;
  box-shadow:0 0 0 1px rgba(12,17,22,.06), 0 40px 80px -32px rgba(8,8,11,.55), 0 12px 28px -18px rgba(8,8,11,.35);
  padding:40px 36px 32px;
}
.auth__card--wide{ max-width:520px; }

.auth__title{ font-size:30px; font-weight:500; line-height:1.15; letter-spacing:-.028em; color:var(--ink); }
.auth__sub{ margin-top:10px !important; font-size:15.5px; color:var(--ink-2); line-height:1.6; }

.auth__foot{
  margin-top:24px !important; padding-top:20px;
  border-top:1px solid #EEF0F3;
  font-size:14.5px; color:var(--ink-3); text-align:center;
}
.auth__foot a{ color:var(--brand); font-weight:560; }
.auth__foot a:hover{ text-decoration:underline; }

.auth__legal{
  margin-top:18px !important; font-size:13px; line-height:1.55;
  color:var(--ink-3); text-align:center;
}
.auth__legal a{ text-decoration:underline; }

/* ---------------- fields ---------------- */

.form{ margin-top:26px; display:grid; gap:16px; }

.field{ display:grid; gap:7px; }
.field__label{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  font-size:13.5px; font-weight:560; color:var(--ink);
}
.field__label a{ font-size:13px; font-weight:500; color:var(--brand); }
.field__label a:hover{ text-decoration:underline; }

.field input{
  width:100%; height:48px;
  font:inherit; font-size:15px;
  color:var(--ink);
  background:#fff;
  border:1px solid var(--line-strong);
  border-radius:14px;
  padding:0 16px;
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input::placeholder{ color:var(--ink-4); }
.field input:hover{ border-color:var(--ink-4); }
.field input:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 4px var(--brand-soft);
}
.field input[aria-invalid="true"]{ border-color:#D93A44; }

.field__wrap{ position:relative; }
.field__wrap input{ padding-right:66px; }
.field__toggle{
  position:absolute; right:7px; top:50%; transform:translateY(-50%);
  background:none; border:0; cursor:pointer;
  font:inherit; font-size:13px; font-weight:560; color:var(--ink-3);
  padding:7px 11px; border-radius:999px;
}
.field__toggle:hover{ color:var(--ink); background:var(--panel); }

.field__hint{ font-size:13px; color:var(--ink-3); line-height:1.5; }

.btn--block{ width:100%; }

/* ---------------- google + divider ---------------- */

.gbtn{ margin-top:26px; display:flex; justify-content:center; min-height:44px; }
.gbtn > div{ width:100% !important; }

.divider{
  display:flex; align-items:center; gap:14px;
  margin:22px 0 2px;
  font-size:12px; font-weight:560; letter-spacing:.06em;
  text-transform:uppercase; color:var(--ink-4);
}
.divider::before, .divider::after{
  content:""; flex:1; height:1px; background:#EEF0F3;
}

/* ---------------- alerts ---------------- */

.alert{
  margin-top:20px;
  font-size:14px; line-height:1.5;
  padding:12px 16px;
  border-radius:14px;
  border:1px solid;
}
.alert--error  { color:#8A1F27; background:#FEF2F3; border-color:#F7D4D7; }
.alert--success{ color:#14532D; background:#F0FDF4; border-color:#C8EBD5; }
.alert--info   { color:var(--brand-ink); background:var(--brand-soft); border-color:var(--brand-line); }

/* ---------------- spinner ---------------- */

.spinner{
  display:inline-block; width:15px; height:15px;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:spin .7s linear infinite;
}
.btn--ghost .spinner{ border-color:rgba(12,17,22,.2); border-top-color:var(--ink); }
@keyframes spin{ to{ transform:rotate(360deg); } }

.loading{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:48px 0; color:var(--ink-3); font-size:15px;
}
.loading .spinner{ border-color:rgba(12,17,22,.15); border-top-color:var(--brand); }

@media (prefers-reduced-motion:reduce){
  .spinner{ animation-duration:2s; }
}

/* ---------------- signup consent ----------------
   The whole row is the label, so the text is a hit target too —
   a 16px tick box on a phone is not one. */
.consent{
  display:flex; align-items:flex-start; gap:10px;
  font-size:13px; line-height:1.55; color:var(--ink-3);
  cursor:pointer; margin-top:2px;
}
.consent input{
  flex:none; width:16px; height:16px; margin:1px 0 0;
  accent-color:var(--brand); cursor:pointer;
}
.consent span{ flex:1; min-width:0; }
.consent:hover span{ color:var(--ink-2); }

/* ---------------- connect page ---------------- */

.connect__app{
  display:flex; align-items:center; gap:14px;
  padding:16px; margin-top:24px;
  border-radius:18px;
  background:var(--page-alt); box-shadow:inset 0 0 0 1px #EEF0F3;
}
.connect__app strong{ display:block; font-size:15px; font-weight:600; }
.connect__app span{ font-size:13.5px; color:var(--ink-3); }

.perms{ display:grid; gap:10px; margin:22px 0 4px; padding:0; list-style:none; }
.perms li{ display:flex; align-items:flex-start; gap:10px; font-size:14.5px; color:var(--ink-2); line-height:1.5; }
.perms svg{ flex:none; margin-top:3px; color:var(--brand); }

/* Success tick on the connect page. Rendered before the clipio:// jump, so
   this is what sits behind the browser's "Open Clipio?" dialog — it has to
   read as done, not as pending. */
.tick{
  width:52px; height:52px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:20px;
  color:#14532D; background:#E7F8EE;
  animation:tick-in .32s var(--ease) both;
}
@keyframes tick-in{
  from{ transform:scale(.7); opacity:0; }
  to  { transform:scale(1);  opacity:1; }
}
@media (prefers-reduced-motion:reduce){ .tick{ animation:none; } }

/* The verify page centres everything, the tick included. */
.auth__card.center .tick{ margin-inline:auto; }

@media (max-width:520px){
  .auth{ padding:40px 0 88px; }
  .auth__card{ padding:32px 22px 26px; border-radius:24px; }
  .auth__title{ font-size:26px; }
}

/* =========================================================
   Account settings — masthead, sidebar tabs, card grid
   ========================================================= */

/* demo-mode ribbon, so a mocked dashboard can never be mistaken for a real one */
.demobar{
  background:var(--brand); color:#fff;
  font-size:13px; text-align:center; padding:8px 16px;
}
.demobar code{ font-size:12px; opacity:.85; }

/* A shorter masthead: the account is the content, not the title. */
.masthead--account{ padding:56px 0 132px; }
.masthead--account + .section{ padding-top:0; margin-top:-64px; position:relative; }
.masthead--account .masthead__who{
  display:inline-flex; align-items:center; gap:10px; margin-top:22px;
  padding:6px 16px 6px 6px; border-radius:999px;
  background:rgba(255,255,255,.1); box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
  color:#fff; font-size:14px; font-weight:500;
}
.masthead__who .avatar{ width:30px; height:30px; font-size:12px; border:0; }
.masthead__who span:last-child{ max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.avatar{
  width:34px; height:34px; border-radius:50%;
  object-fit:cover; flex:none;
  background:var(--brand); color:#fff;
  display:inline-flex; align-items:center; justify-content:center;
  font-weight:600; font-size:14px; letter-spacing:-.01em;
  border:1px solid var(--line);
  overflow:hidden;
}

/* the panel that holds the tabs and panes, lifted onto the masthead's tail */
.set{
  border-radius:28px; background:#F7F8FA;
  box-shadow:0 0 0 1px rgba(12,17,22,.06), 0 30px 60px -36px rgba(8,8,11,.45);
  padding:24px;
}
.set__body{
  display:grid; grid-template-columns:220px minmax(0, 1fr); gap:28px;
  align-items:start;
}
.set__state{ max-width:640px; margin:0 auto; }

/* ---------------- sidebar tabs ---------------- */

.set__nav{
  display:flex; flex-direction:column; gap:2px;
  position:sticky; top:24px;
}
.set__navhead{
  color:var(--ink-4); font-size:11px; font-weight:620; letter-spacing:.06em; text-transform:uppercase;
  padding:4px 14px 10px;
}
.tab{
  display:flex; align-items:center; gap:11px;
  padding:10px 14px; border-radius:999px; border:0;
  background:transparent; cursor:pointer;
  font:inherit; font-size:14.5px; font-weight:500; color:var(--ink-2);
  text-align:left; width:100%;
  transition:background .14s var(--ease), color .14s var(--ease), box-shadow .14s var(--ease);
}
.tab svg{ flex:none; opacity:.75; }
.tab:hover{ background:#fff; color:var(--ink); }
.tab[aria-current="true"]{
  background:#fff; color:var(--ink); font-weight:560;
  box-shadow:0 1px 3px rgba(12,17,22,.08), 0 0 0 1px #E5E7EB;
}
.tab[aria-current="true"] svg{ opacity:1; color:var(--brand); }

/* ---------------- panes + cards ---------------- */

.pane{ display:grid; gap:18px; grid-template-columns:repeat(2, minmax(0, 1fr)); align-items:start; }

/* The sub-pages' soft white card. */
.scard{
  background:#fff; border-radius:22px;
  box-shadow:0 1px 2px rgba(12,17,22,.04), 0 0 0 1px rgba(12,17,22,.07);
  padding:24px 26px;
}
.scard--wide{ grid-column:1 / -1; }
.scard--row{
  grid-column:1 / -1;
  display:flex; align-items:center; justify-content:space-between;
  gap:24px; flex-wrap:wrap;
}
.scard h2{ font-size:18px; font-weight:600; letter-spacing:-.018em; margin:0 0 6px; }
.scard p.sub{ font-size:14.5px; line-height:1.6; color:var(--ink-2); margin:0 0 18px; }
.scard p.sub:last-child{ margin-bottom:0; }

.card__actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }

/* the "everything unlocked" list */
.feats{ display:grid; gap:10px; margin:4px 0 0; padding:0; list-style:none; }
.feats li{
  display:flex; align-items:flex-start; gap:10px;
  font-size:15px; color:var(--ink-2); line-height:1.5;
}
.feats svg{ flex:none; margin-top:3px; color:var(--brand); }

.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:620; letter-spacing:.05em; text-transform:uppercase;
  padding:5px 11px; border-radius:var(--r-full);
  color:var(--brand); background:var(--brand-soft);
}
.badge--ok  { color:#14532D; background:#E7F8EE; }
.badge--warn{ color:#8A5A00; background:#FFF6E5; }

.btn--icon{ padding:9px 11px; }
.btn--danger-solid{ background:#D93A44; color:#fff; border-color:#C22A34; }
.btn--danger-solid:hover{ background:#C22A34; }

/* toggle row */
.toggle{
  display:flex; align-items:flex-start; gap:12px;
  padding:16px 0; border-top:1px solid #EEF0F3;
}
.toggle:first-of-type{ border-top:0; padding-top:0; }
.toggle input{ flex:none; width:17px; height:17px; margin:2px 0 0; accent-color:var(--brand); cursor:pointer; }
.toggle strong{ display:block; font-size:15px; font-weight:560; margin-bottom:3px; }
.toggle span{ font-size:14px; line-height:1.55; color:var(--ink-3); }

.saverow{ display:flex; align-items:center; gap:12px; margin-top:18px; }
/* The saved-confirmation flash. Not scoped to .saverow: the profile tab
   puts one inside a row instead, and a descendant selector there meant
   the word "Saved" simply sat on screen permanently. */
.ok{ font-size:13px; color:#14532D; font-weight:600; opacity:0; transition:opacity .2s; }
.ok.show{ opacity:1; }

/* =========================================================
   Profile tab — header + grouped rows
   ---------------------------------------------------------
   The cover is drawn in CSS, not uploaded: the masthead's own
   black-to-blue run, so the profile reads as part of the same
   page rather than a separate widget.
   ========================================================= */

.pane--profile{ grid-template-columns:minmax(0, 1fr); max-width:820px; }

.phead{
  background:#fff; border-radius:22px; overflow:hidden;
  box-shadow:0 1px 2px rgba(12,17,22,.04), 0 0 0 1px rgba(12,17,22,.07);
}
.phead__cover{
  height:140px;
  background:
    radial-gradient(60% 120% at 20% 100%, rgba(92,140,255,.55), transparent 70%),
    linear-gradient(100deg, #08080B 0%, #0B1A55 45%, #0F3FD6 80%, #5C8CFF 100%);
}

.phead__body{
  padding:0 26px 24px;
  display:flex; align-items:flex-end; gap:20px; flex-wrap:wrap;
}
/* Overlaps the cover by half its height. The white ring is what keeps it
   readable against the gradient. */
.phead__avatar{
  width:104px; height:104px; font-size:34px;
  margin-top:-52px; flex:none; align-self:flex-start;
  border:4px solid #fff;
  box-shadow:var(--shadow-sm);
}

.phead__id{ flex:1; min-width:240px; padding-top:14px; }
.phead__id h1{
  font-size:28px; font-weight:500; letter-spacing:-.028em; line-height:1.2;
  margin:0; overflow-wrap:anywhere;
}
.phead__mail{
  display:flex; align-items:center; gap:6px;
  margin:6px 0 0; font-size:14.5px; color:var(--ink-3);
  overflow-wrap:anywhere;
}
.phead__meta{ margin:12px 0 0; font-size:14px; color:var(--ink-3); }
.phead__meta b{ color:var(--ink-2); font-weight:560; }

.phead__acts{ display:flex; align-items:center; gap:8px; padding-bottom:2px; }

/* copy-to-clipboard, next to the email */
.copybtn{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; flex:none;
  border:0; border-radius:999px; background:transparent;
  color:var(--ink-3); cursor:pointer;
  transition:background .14s var(--ease), color .14s var(--ease);
}
.copybtn:hover{ background:var(--panel); color:var(--ink); }
.copybtn svg{ width:14px; height:14px; }
.copybtn.is-done{ color:#17803D; }

/* the badge chips under the name */
.chips{ display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.chipx{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12.5px; font-weight:500; color:var(--ink-2);
  background:#fff; border:1px solid var(--line);
  padding:6px 12px; border-radius:var(--r-full);
}
.chipx svg{ width:13px; height:13px; flex:none; color:var(--ink-3); }
.chipx--ok  { color:#14532D; background:#E7F8EE; border-color:#C7EDD6; }
.chipx--ok svg{ color:#17803D; }
.chipx--warn{ color:#8A5A00; background:#FFF6E5; border-color:#F5E0B5; }
.chipx--warn svg{ color:#B07400; }
.chipx--brand{ color:var(--brand-ink); background:var(--brand-soft); border-color:var(--brand-line); }
.chipx--brand svg{ color:var(--brand); }

/* a labelled group of rows inside a card */
.grouphead{
  display:flex; align-items:center; gap:8px;
  color:var(--ink-4); font-size:11px; font-weight:620; letter-spacing:.06em; text-transform:uppercase;
  margin:34px 0 8px !important;
}
.grouphead:first-child{ margin-top:0 !important; }
.grouphead svg{ width:14px; height:14px; flex:none; }

/* key/value rows.
   minmax(0,1fr): a grid item's automatic minimum size is its min-content
   width, so a row holding an input and two buttons would set the track — and
   the card, and the page — wider than the screen. */
.kv{ display:grid; grid-template-columns:minmax(0, 1fr); }
.kv__row{
  min-width:0;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 0;
  border-bottom:1px solid #EEF0F3;
  font-size:15px;
}
.kv__row:last-child{ border-bottom:0; padding-bottom:0; }
.kv__row:first-child{ padding-top:0; }
.kv__key{ color:var(--ink-3); }
.kv__val{ min-width:0; overflow-wrap:anywhere; font-weight:560; text-align:right; }

/* A row whose right-hand side is a control rather than a value. The input
   stays at a readable width instead of stretching the full card. */
.kv__row--input{ flex-wrap:wrap; }
.kv__edit{ min-width:0; display:flex; align-items:center; gap:8px; margin-left:auto; }
.kv__edit input{
  width:220px; max-width:100%; height:38px;
  padding:0 14px; font:inherit; font-size:14px;
  color:var(--ink); background:#fff;
  border:1px solid var(--line-strong); border-radius:999px;
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.kv__edit input:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-soft); }

/* ---------------- responsive ---------------- */

@media (max-width:900px){
  /* minmax(0,1fr), not 1fr. A grid item's automatic minimum size is its
     min-content size, so the tab strip below — whose five buttons are wider
     than a phone — stretched the track past the viewport and took the whole
     page with it. Letting the track floor at 0 makes the nav scroll inside
     itself instead. */
  .set__body{ grid-template-columns:minmax(0, 1fr); gap:18px; }
  .set__body > *{ min-width:0; }
  .set__nav{ position:static; flex-direction:row; overflow-x:auto; gap:6px; padding-bottom:4px; }
  .set__navhead{ display:none; }
  .tab{ width:auto; white-space:nowrap; }
  .pane{ grid-template-columns:1fr; }
}

@media (max-width:720px){
  .set{ padding:14px; border-radius:24px; }
  .scard{ padding:20px; }
  .card__actions .btn{ width:100%; }

  /* Stack instead of sitting side by side: at this width the identity column
     is narrow enough that even a short name wraps beside the avatar. */
  .phead__body{ flex-direction:column; align-items:stretch; gap:14px; padding:0 20px 20px; }
  .phead__avatar{ width:84px; height:84px; font-size:28px; margin-top:-42px; }
  .phead__id{ min-width:0; padding-top:0; }
  .phead__acts{ width:100%; }

  /* Label on its own line, value beneath it and left-aligned. Side by side
     there is not enough width left for a value like an email address plus
     its badge and button. */
  .kv__row{ flex-wrap:wrap; gap:6px 12px; }
  .kv__edit{ margin-left:0; width:100%; flex-wrap:wrap; justify-content:flex-start; }
  .kv__val{ text-align:left; }
  .kv__edit input{ flex:1; min-width:0; width:auto; }
}

/* ---------- key box (activate.html) ---------- */
.keybox{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:17px; letter-spacing:.04em;
  background:#F5F7FA; border:1px solid var(--line); border-radius:10px; padding:14px; margin-top:18px; text-align:center; user-select:all; }
