/* Shared styling for the Koda auth pages (login / register / account).
   Mirrors the Tokyo Night palette + buttons from index.html so the pages feel
   native, without pulling in the whole landing stylesheet. */
:root {
  --bg: #08080c;
  --bg-2: #0b0b12;
  --panel: #101019;
  --panel-2: #14141f;
  --elevated: #1a1b29;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --text: #eceefb;
  --muted: #9aa0c4;
  --faint: #646b97;
  --primary: #7aa2f7;
  --primary-hi: #a9c1ff;
  --accent: #bb9af7;
  --ok: #9ece6a;
  --warn: #e0af68;
  --danger: #f7768e;
  --radius: 18px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(122, 162, 247, 0.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-nav {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}
.auth-brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
}
.auth-brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-nav a.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.auth-nav a.back:hover {
  color: var(--text);
}

.auth-wrap {
  flex: 1;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}
.auth-card .sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oauth-icon {
  flex: 0 0 auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  transition: border-color 0.15s, filter 0.15s, background 0.15s;
}
.btn:hover {
  border-color: var(--primary);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(180deg, var(--primary-hi), var(--primary));
  border-color: transparent;
  color: #0a0a12;
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.field input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 12px;
  outline: none;
}
.field input:focus {
  border-color: var(--primary);
}

.msg {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 14px;
}
.msg.err {
  background: rgba(247, 118, 142, 0.1);
  border: 1px solid rgba(247, 118, 142, 0.35);
  color: #ff9fb2;
}
.msg.ok {
  background: rgba(158, 206, 106, 0.1);
  border: 1px solid rgba(158, 206, 106, 0.35);
  color: #bfe89a;
}
.hidden {
  display: none;
}

.switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.switch a {
  color: var(--primary);
  text-decoration: none;
}
.switch a:hover {
  text-decoration: underline;
}

/* account page */
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.acct-row:last-of-type {
  border-bottom: none;
}
.acct-row .k {
  color: var(--muted);
}
.tier-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--muted);
}
.tier-pill.pro {
  background: linear-gradient(180deg, var(--primary-hi), var(--primary));
  color: #0a0a12;
  border-color: transparent;
}
.tier-pill.team {
  color: var(--ok);
  border-color: var(--ok);
}
.acct-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* profile + billing hub (wider account card) */
.auth-card.acct {
  max-width: 560px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}
.avatar {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--elevated), var(--panel-2));
  border: 1px solid var(--border-2);
  color: var(--primary-hi);
  font-weight: 800;
  font-size: 20px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* The avatar doubles as the "change picture" button on account.html. */
.avatar-btn {
  position: relative;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.avatar-face {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}
.avatar-edit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 0 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.avatar-btn:hover .avatar-edit,
.avatar-btn:focus-visible .avatar-edit {
  opacity: 1;
}
.photo-links {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.linklike {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  color: var(--primary-hi);
}
.linklike:hover {
  text-decoration: underline;
}
.linklike.danger {
  color: var(--danger);
}
.profile-head .who {
  min-width: 0;
}
.profile-head .who .nm {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.profile-head .who .em {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sec {
  margin-top: 26px;
}
.sec-title {
  margin: 0 0 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
}
/* a label/input + inline Save button on one baseline */
.row-edit {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.row-edit .field {
  flex: 1;
  margin-bottom: 14px;
}
.btn.inline {
  width: auto;
  white-space: nowrap;
  margin-bottom: 14px;
}
.note {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
  margin: -6px 0 4px;
}
.soon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--faint);
}
.plan-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}
