/* Elysium account pages: forms, cards and the account dashboard. Builds on /styles.css. */

.auth-main {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 110px var(--gutter) 48px;
}
.auth-card { width: 100%; max-width: 440px; padding: 34px 32px 30px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; }
.auth-card .sub { margin-top: 8px; color: var(--text-dim); font-size: 15px; }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.auth-head img { width: 52px; height: 52px; margin-bottom: 16px; filter: drop-shadow(0 10px 28px var(--accent-glow)); }
.js .auth-card { animation: heroIn 700ms var(--ease) both; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.input-wrap { position: relative; }
.field input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  font: 500 15.5px var(--font); color: var(--text);
  background: rgba(10, 9, 18, 0.45); border: 1px solid var(--glass-border);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.field input::placeholder { color: var(--text-faint); }
.field input:hover { border-color: rgba(255, 255, 255, 0.2); }
.field input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); background: rgba(10, 9, 18, 0.6); }
.field.invalid input { border-color: rgba(248, 113, 113, 0.7); }
.field.invalid input:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }
.field .has-toggle { padding-right: 48px; }
.toggle-pass {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 9px; border: 0;
  display: grid; place-items: center; background: transparent; color: var(--text-faint); cursor: pointer;
}
.toggle-pass:hover { color: var(--text); background: var(--glass-hover); }
.toggle-pass svg { width: 19px; height: 19px; }
.field-hint { font-size: 13px; color: var(--text-faint); }
.field-error { font-size: 13px; color: #fca5a5; min-height: 0; }
.field-error:empty { display: none; }
.field.invalid .field-hint { display: none; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.strength span { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); transition: background var(--normal) var(--ease); }
.strength-label { font-size: 13px; color: var(--text-faint); }
.strength[data-level="1"] span:nth-child(-n+1) { background: #f87171; }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] span:nth-child(-n+3) { background: #a3e635; }
.strength[data-level="4"] span:nth-child(-n+4) { background: #34d399; }

.captcha { display: flex; justify-content: center; min-height: 65px; }
.captcha[hidden] { display: none; }

.btn-block {
  position: relative; width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 14px; cursor: pointer;
  font: 650 16px var(--font); color: #fff;
  background: linear-gradient(135deg, #8f74ff, var(--accent) 55%, #5b3ce6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 32px var(--accent-glow);
  transition: transform var(--fast) var(--ease), box-shadow var(--normal) var(--ease), opacity var(--fast);
}
.btn-block:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 14px 40px rgba(124, 92, 255, 0.55); }
.btn-block:active { transform: scale(0.99); }
.btn-block:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-block.secondary { background: var(--glass); border: 1px solid var(--glass-border); box-shadow: none; }
.btn-block.secondary:hover { background: var(--glass-hover); }
.btn-block.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 10px 30px rgba(220, 38, 38, 0.35); }
a.btn-block { display: grid; place-items: center; }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.5;
  background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.35); color: #fecaca;
}
.alert.ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #bbf7d0; }
.alert.info { background: var(--accent-soft); border-color: rgba(124, 92, 255, 0.4); color: #e5dcff; }
.alert[hidden] { display: none; }

.auth-links { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; font-size: 14.5px; color: var(--text-dim); text-align: center; }
.auth-links a, .text-link { color: var(--accent-2); font-weight: 600; }
.auth-links a:hover, .text-link:hover { text-decoration: underline; }
.form-row { display: flex; justify-content: flex-end; margin-top: -6px; font-size: 14px; }

.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.done-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(90, 209, 255, 0.12)); border: 1px solid rgba(180, 140, 255, 0.35);
}
.done-icon svg { width: 30px; height: 30px; color: #e5dcff; }
.done-icon.bad { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.done-icon.bad svg { color: #fca5a5; }
.done p { color: var(--text-dim); }
.done .btn-block { margin-top: 8px; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--accent-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Account dashboard ---------- */
.profile { display: flex; align-items: center; gap: 18px; }
.avatar {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-size: 28px; font-weight: 750; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, #8f74ff, #5b3ce6 60%, #3a7bff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 10px 30px var(--accent-glow);
}
.profile h1 { font-size: 26px; word-break: break-all; }
.profile .sub { margin-top: 2px; }
.account-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.account-section h2 { font-size: 17px; font-weight: 650; margin-bottom: 14px; }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 15px; }
.info-list dt { color: var(--text-faint); }
.info-list dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; word-break: break-all; }
.badge { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.badge.warn { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.link-btn { border: 0; background: none; padding: 0; font: 600 14px var(--font); color: var(--accent-2); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn-block { margin-top: 0; height: 46px; font-size: 15px; }
.danger-zone p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 14px; }
details.collapsible summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.collapsible summary h2 { margin-bottom: 0; }
details.collapsible summary::after {
  content: ""; width: 9px; height: 9px; margin: -4px 6px 0 0;
  border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg); transition: transform var(--normal) var(--ease);
}
details.collapsible[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
details.collapsible summary:hover h2 { color: var(--accent-2); }
.danger-zone summary h2 { color: #fca5a5; }
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible[open] summary { margin-bottom: 16px; }

/* ---------- Privacy policy ---------- */
.prose { font-size: 15.5px; color: var(--text-dim); }
.prose h2 { font-size: 19px; color: var(--text); margin: 28px 0 10px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose b { color: var(--text); font-weight: 600; }

.auth-footer { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; color: var(--text-faint); }
.auth-footer a:hover { color: var(--text); }

@media (max-width: 680px) {
  .auth-main { padding: 88px var(--gutter) 32px; justify-content: flex-start; }
  .auth-card { padding: 26px 20px 24px; border-radius: 18px; }
  .auth-card h1 { font-size: 24px; }
  .btn-row { grid-template-columns: 1fr; }
  .profile .avatar { width: 54px; height: 54px; font-size: 24px; border-radius: 15px; }
  .profile h1 { font-size: 22px; }
}

/* Recovery codes */
.field label .optional { font-weight: 500; color: var(--text-faint); }
.recovery-code {
  display: block; width: 100%; padding: 16px 12px; border-radius: 14px; user-select: all;
  font: 700 26px/1.2 var(--mono); letter-spacing: 0.12em; color: #fff;
  background: rgba(10, 9, 18, 0.55); border: 1px dashed rgba(167, 139, 250, 0.55);
}
.recovery .btn-row { width: 100%; }
.recovery-warn { font-size: 13.5px; color: #fcd34d !important; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-2); }
.recovery .js-next { width: 100%; }
.field .code-input { font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.section-text { color: var(--text-dim); font-size: 14.5px; margin: 12px 0 14px; }
.badge[hidden] { display: none; }

/* Admin */
#admin-result { margin-top: 18px; }
#admin-result h1 { font-size: 20px; }
.subhead { font-size: 15px; font-weight: 650; margin: 22px 0 10px; }
.admin-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.admin-log li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.admin-log .muted { color: var(--text-faint); background: none; padding: 0; }
.log-head { font-weight: 600; word-break: break-word; }
.log-meta { margin-top: 3px; color: var(--text-faint); font-size: 13px; word-break: break-word; }
@media (max-width: 420px) {
  .recovery-code { font-size: 21px; letter-spacing: 0.06em; }
}

/* ===== Subscription and key admin ===== */
.sub-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; color: var(--text-dim); font-size: 15px; }
#sub-download { grid-template-columns: 1fr; margin-bottom: 16px; }
#sub-download[hidden] { display: none; }
.field select {
  width: 100%; height: 48px; padding: 0 12px; border-radius: 12px; appearance: none;
  font: 500 15.5px var(--font); color: var(--text);
  background: rgba(10, 9, 18, 0.45); border: 1px solid var(--glass-border);
}
.field select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.field select option { background: #12101e; color: var(--text); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.keys-result { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(52, 211, 153, 0.06); border: 1px solid rgba(52, 211, 153, 0.25); }
.keys-result[hidden] { display: none; }
.keys-warning { color: #6ee7b7; font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.keys-output { margin: 0 0 12px; padding: 12px; max-height: 220px; overflow: auto; border-radius: 10px; background: rgba(10, 9, 18, 0.55); font: 500 14px var(--mono); color: var(--text); user-select: all; }
.search-row { display: flex; gap: 10px; margin-bottom: 10px; }
.search-row input {
  flex: 1; height: 42px; padding: 0 12px; border-radius: 12px; font: 500 14.5px var(--font); color: var(--text);
  background: rgba(10, 9, 18, 0.45); border: 1px solid var(--glass-border);
}
.search-row .btn-block { margin-top: 0; width: auto; height: 42px; padding: 0 18px; }
.key-row { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
.key-row .log-head, .key-row .log-meta { grid-column: 1; }
.key-row .danger-link { grid-column: 2; grid-row: 1 / span 2; }
.danger-link { color: #fca5a5; }
@media (max-width: 680px) {
  .field-row { grid-template-columns: 1fr; }
}
