/* The hidden attribute must always win over .form's display:flex. */
[hidden] { display: none !important; }

.account-body {
  overflow: auto;
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: 2.5rem 1rem 4rem;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(79,140,255,0.14), transparent 70%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 1.6rem 1.8rem 2rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.back:hover { color: var(--fg); }

/* Brand mark at the top of the card */
.card-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.2rem 0 0.4rem;
}
.card-logo img { width: 34px; height: 34px; }
.card-logo span { font-weight: 700; letter-spacing: 0.02em; font-size: 1.05rem; }

.card h1 { font-size: 1.45rem; margin: 0.2rem 0 0.3rem; }
.card h2 {
  font-size: 0.78rem; margin: 1.8rem 0 0.7rem; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; line-height: 1.45; }

.form { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }

input[type=email], input[type=password], input[type=text] {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: var(--fg);
  padding: 0.8rem 0.95rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

/* One-time-code inputs: big, centered, spaced */
#totpCode, #enableCode, #disableCode {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  font-variant-numeric: tabular-nums;
}

.btn-fill {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 0.82rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 8px 20px -8px rgba(79, 140, 255, 0.6);
}
.btn-fill:hover { background: #3f7bf0; }
.btn-fill:active { transform: translateY(1px); }
.btn-fill:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  margin-top: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  border-radius: 11px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.3); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: #fff; color: #1f2329;
  border-radius: 11px; padding: 0.82rem;
  text-decoration: none; font-weight: 600;
  transition: background 0.15s, transform 0.05s;
}
.btn-google:hover { background: #f1f3f6; }
.btn-google:active { transform: translateY(1px); }
.btn-google svg { width: 20px; height: 20px; fill: #4285f4; }

.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); margin: 1.2rem 0; font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }

.reg { margin-top: 1.2rem; }
.reg summary { color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.reg summary:hover { color: var(--fg); }

.admin-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0.2rem 0 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: rgba(79,140,255,0.12);
  border: 1px solid rgba(79,140,255,0.3);
  color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600;
}
.admin-pill:hover { background: rgba(79,140,255,0.2); }

.card-footer { margin-top: 1.6rem; text-align: center; }
.card-footer a { color: var(--muted); font-size: 0.82rem; text-decoration: none; }
.card-footer a:hover { color: var(--fg); text-decoration: underline; }

.msg { margin-top: 1rem; font-size: 0.9rem; min-height: 1.2em; }
.msg.error { color: #ff6b6b; }
.msg.ok { color: #5fd38a; }

.upload { display: flex; gap: 0.6rem; align-items: center; }
.file-label {
  flex: 1;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px; padding: 0.75rem; text-align: center;
  color: var(--muted); cursor: pointer; font-size: 0.9rem;
}
.file-label:hover { border-color: var(--accent); color: var(--fg); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 1rem; }
.gallery .thumb {
  aspect-ratio: 1; border-radius: 10px; background-size: cover; background-position: center;
  cursor: pointer; border: 2px solid transparent; position: relative;
}
.gallery .thumb.selected { border-color: var(--accent); }
.gallery .thumb.none {
  background: rgba(0,0,0,0.3); display: grid; place-items: center;
  color: var(--muted); font-size: 0.8rem;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
  margin: 0.2rem 0 0.3rem;
}
.consent input[type=checkbox] {
  width: 1.1rem; height: 1.1rem; margin-top: 0.1rem;
  accent-color: var(--accent); flex: 0 0 auto; cursor: pointer;
}
.consent a { color: var(--accent); }

.links {
  margin-top: 1.1rem;
  display: flex; gap: 0.6rem; justify-content: center;
  font-size: 0.9rem; color: var(--muted);
}
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

.notice {
  margin-top: 1rem; padding: 0.9rem;
  background: rgba(79,140,255,0.1);
  border: 1px solid rgba(79,140,255,0.25);
  border-radius: 10px; font-size: 0.9rem;
}
.notice p { margin-bottom: 0.6rem; }

.qr {
  width: 200px; height: 200px; margin: 0.6rem auto;
  background: #fff; padding: 8px; border-radius: 8px;
}
.qr svg { width: 100%; height: 100%; }

.secret { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0.8rem; }
.secret code {
  background: rgba(0,0,0,0.3); padding: 0.15rem 0.4rem; border-radius: 5px;
  color: var(--fg); user-select: all;
}
