/* ============================================================
   Shared styles for the app pages (auth, dashboard) that sit on
   top of style.css's base tokens/palette.
   ============================================================ */

/* ---------- auth page ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-brand {
  position: fixed; top: 28px; left: 32px; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 16px;
}
.auth-market-link {
  position: fixed; top: 32px; right: 32px;
  font-family: var(--mono); font-size: 13px; color: var(--muted); text-decoration: none;
}
.auth-market-link:hover { color: var(--text); }
.auth-shell { width: 100%; display: flex; justify-content: center; }
.auth-fade-in { animation: auth-in .5s ease both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 32px 30px;
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.7);
}
.auth-tabs { display: flex; background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 26px; }
.auth-tab {
  flex: 1; background: none; border: none; color: var(--muted); font-family: var(--sans);
  font-weight: 600; font-size: 13.5px; padding: 9px 0; border-radius: 7px; cursor: pointer;
  transition: background .2s, color .2s;
}
.auth-tab.active { background: var(--card); color: var(--text); }

.auth-form { display: none; flex-direction: column; }
.auth-form.active { display: flex; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 24px; }

.social-row { display: flex; gap: 10px; margin-bottom: 20px; }
.btn-social {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--card-alt); border: 1px solid var(--border); color: var(--text);
  font-family: var(--sans); font-weight: 600; font-size: 13.5px; padding: 11px 0; border-radius: 9px;
  cursor: pointer; transition: border-color .2s, background .2s, transform .15s;
}
.btn-social:hover { border-color: var(--border-hover); background: var(--card-hover); }
.btn-social:active { transform: scale(0.97); }
.btn-social svg { width: 17px; height: 17px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-dim); font-family: var(--mono); font-size: 11px; margin-bottom: 20px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.field input, .field select {
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; color: var(--text); font-family: var(--sans); font-size: 14px;
  outline: none; transition: border-color .2s, background .2s;
}
.field input:focus { border-color: var(--accent); background: var(--bg-alt); }
.field input::placeholder { color: var(--muted-dim); }

.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.check.block { margin-bottom: 20px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.muted-link { color: var(--muted); font-size: 13px; transition: color .2s; }
.muted-link:hover { color: var(--accent); }

.btn-lg { padding: 13px 0; font-size: 14.5px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-error {
  display: none; margin-top: 16px; font-size: 13px; color: var(--red);
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25);
  padding: 10px 12px; border-radius: 9px;
}
.auth-error.show { display: block; }

/* verification step */
.verify-code-row { display: flex; gap: 9px; margin-bottom: 22px; }
.verify-code-row input {
  width: 100%; text-align: center; font-family: var(--mono); font-size: 20px; font-weight: 700;
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  padding: 12px 0; outline: none; transition: border-color .2s;
}
.verify-code-row input:focus { border-color: var(--accent); }
.resend-row { text-align: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.resend-row button { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; font-family: var(--sans); }
.resend-row button:disabled { color: var(--muted-dim); cursor: default; }
.verify-target { font-family: var(--mono); color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; font-size: 13.5px; color: var(--text); z-index: 300;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- app shell (dashboard) ---------- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-side {
  border-right: 1px solid var(--border); background: var(--bg-alt);
  padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.app-brand { margin-bottom: 26px; padding: 0 6px; }
.app-account { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 22px; }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(145deg, var(--accent), #b91c1c);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; color: #fff; flex-shrink: 0;
}
.app-account-name { font-size: 12.5px; font-weight: 600; }
.app-account-plan { font-size: 11px; color: var(--muted); }

.app-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.app-nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; color: var(--muted); cursor: pointer; transition: background .18s, color .18s;
  border-left: 2px solid transparent;
}
.app-nav-item:hover { background: var(--card-alt); color: var(--text); }
.app-nav-item.active { background: var(--card-alt); color: var(--text); border-left-color: var(--accent); }
.app-signout { margin-top: auto; }

.app-main { padding: 34px 44px; overflow-y: auto; }
.app-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.app-topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.muted { color: var(--muted); font-size: 14px; margin-top: 5px; }

.live-pill {
  display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--green);
  border: 1px solid rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); padding: 7px 14px; border-radius: 100px;
}

.app-view { display: none; }
.app-view.active { display: block; animation: view-in .35s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.app-stat-row { margin-bottom: 26px; }
.app-grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
@media (max-width: 980px) { .app-grid-2 { grid-template-columns: 1fr; } .app-shell { grid-template-columns: 1fr; } .app-side { display: none; } }

.panel-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-card-head h3 { font-size: 15px; font-weight: 600; }

.acct-list { display: flex; flex-direction: column; gap: 10px; }
.acct-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; }
.acct-row-left { display: flex; align-items: center; gap: 12px; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; }
.acct-name { font-family: var(--mono); font-size: 13px; }
.acct-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.tag { font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 100px; display: inline-block; }
.tag-green { color: var(--green); background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); }
.tag-muted { color: var(--muted); background: var(--card-alt); border: 1px solid var(--border); }
.tag-amber { color: var(--amber); background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.3); }

.key-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 16px 0;
}
.key-box code { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.5px; }
.kv-list { list-style: none; }
.kv-list li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.kv-list li:first-child { border-top: none; }
.kv-list li span { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted-dim); margin-top: 12px; text-align: center; }

.app-log { height: 220px; }
.app-log-tall { height: 480px; }
.app-addon-grid { grid-template-columns: repeat(4, 1fr); }
.pay-row { display: flex; gap: 8px; margin-top: 18px; }
.pay-row .btn { flex: 1; padding: 9px 4px; font-size: 12.5px; }
@media (max-width: 1180px) { .app-addon-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .app-addon-grid { grid-template-columns: 1fr; } .app-main { padding: 24px 18px; } }
