/* 1:1 app portal language — flat, no dots, Lucide */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Montserrat:wght@600;700;800&display=swap');

:root {
  --bg-base: #0d0d0d;
  --bg-elevated: #141414;
  --bg-active: #111111;
  --input-bg: #141414;
  --input-focus: #f5f5f7;
  --border: #1e1e1e;
  --line: #ffffff0b;
  --text-primary: #f5f5f7;
  --text-secondary: #d0d0d5;
  --text-muted: #7a7a82;
  --faint: #5b5b62;
  --accent: #f5f5f7;
  --success: #6ee7a0;
  --danger: #f27575;
  --warning-bg: #fcbb0014;
  --warning-border: #fcbb0040;
  --warning-text: #fef3c6e6;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg-base); }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
button, input { font: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--input-focus); outline-offset: 2px; }
.field:focus-within { outline: none; }
::selection { background: #ffffff29; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 999px; }

/* branding in-flow (top bar removed) */
.brandline { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 10px; margin-bottom: 20px; align-self: flex-start; }
.brandline:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brandline img { width: 20px; height: 20px; object-fit: contain; user-select: none; flex-shrink: 0; display: block; }
.brandline span { font-family: 'Montserrat', Inter, system-ui, sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; color: var(--text-primary); line-height: 1; }

/* main: flex flex-1 flex-col items-center px-6 py-10 */
.main { display: flex; flex: 1; flex-direction: column; align-items: center; overflow-y: auto; padding: 20px 24px; }
.page { margin: auto 0; width: 100%; max-width: 480px; display: flex; flex-direction: column; animation: view-enter 0.22s var(--ease-out) both; }
@keyframes view-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* h1: mb-6 text-[23px] */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 23px; font-weight: 600; line-height: 1; letter-spacing: -0.015em; color: var(--text-primary); }

/* card: rounded-[14px] bg-elevated ring-1 ring-line/60 p-5 */
.card {
  background: var(--bg-elevated);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* field: h-10 bg-base ring-line/60 rounded */
.field {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 14px;
  border-radius: 10px;
  background: var(--bg-base);
  box-shadow: inset 0 0 0 1px var(--line);
}
.field:focus-within { box-shadow: inset 0 0 0 2px var(--input-focus); }
.field.invalid { box-shadow: inset 0 0 0 1px var(--danger); }
.field-icon { width: 14px; height: 14px; color: var(--faint); flex-shrink: 0; }
.field input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; color: var(--text-primary);
}
.field input::placeholder { color: var(--text-muted); }
.ghost-icon {
  width: 28px; height: 28px; display: grid; place-items: center; flex-shrink: 0;
  background: transparent; border: 0; border-radius: 8px; color: var(--faint); cursor: pointer;
}
.ghost-icon:hover { color: var(--text-primary); background: #ffffff0a; }
.ghost-icon svg { width: 14px; height: 14px; }

/* reserve error space so layout never shifts */
.form-err { min-height: 20px; margin: 8px 0 0; font-size: 12px; line-height: 20px; color: var(--danger); visibility: hidden; }
.form-err:empty::before { content: '\00a0'; }
.form-err.show { visibility: visible; }
.form-err.ok { color: var(--success); }

/* buttons: primary / secondary, sm / lg */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--text-primary); color: var(--bg-base);
  font-weight: 500; transition: filter 0.15s ease, opacity 0.15s ease;
}
.btn-primary svg { width: 14px; height: 14px; }
.btn-primary:hover { filter: brightness(95%); }
.btn-primary:active { filter: brightness(90%); }
.btn-primary:disabled { pointer-events: none; opacity: 0.4; }

/* hover animation for Continue — pure sheen sweep (visible: button darkens, light band sweeps) */
.btn-animated { position: relative; overflow: hidden; isolation: isolate; transition: filter 150ms ease; will-change: filter; }
.btn-animated::after {
  content: ''; position: absolute; inset: -2px; z-index: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.75) 50%, transparent 62%);
  transform: translateX(-130%);
  transition: transform 550ms var(--ease-out);
  pointer-events: none;
  will-change: transform;
}
.btn-animated:hover:not(:disabled) { filter: brightness(88%); }
.btn-animated:hover:not(:disabled)::after { transform: translateX(130%); }
.btn-animated:active:not(:disabled) { filter: brightness(82%); }
.btn-animated.is-loading .btn-arrow { display: none; }
.btn-animated > span, .btn-animated > svg, .btn-animated > i { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn-animated, .btn-animated::after { transition: none; }
}
.btn-lg { height: 40px; padding: 0 16px; font-size: 13px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-min { min-width: 112px; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: #ffffff0f; color: var(--text-primary);
  font-weight: 500; transition: filter 0.15s ease;
}
.btn-secondary svg { width: 14px; height: 14px; }
.btn-secondary:hover { filter: brightness(110%); }

.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.remember { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); cursor: pointer; user-select: none; line-height: 1; }
.remember span { line-height: 16px; display: inline-flex; align-items: center; }
.remember input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; padding: 0; border-radius: 5px; border: 1px solid var(--border); background: transparent; cursor: pointer; display: inline-grid; place-items: center; place-content: center; flex-shrink: 0; align-self: center; line-height: 1; }
.remember input:checked { background: var(--text-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d0d0d' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 10px 10px; border-color: var(--text-primary); }
.remember input:checked::after { content: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer; font-size: 12px; }
.link-btn:hover { color: var(--danger); }

/* dashboard — spacious bento */
[hidden] { display: none !important; }
.page-wide { max-width: 720px; }
.dash-head p { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }
.greet { display: flex; align-items: center; gap: 8px; }
.name-eye { width: 26px; height: 26px; }
.name-eye svg { width: 14px; height: 14px; }
.dash-col { display: flex; flex-direction: column; gap: 12px; }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bento .card { gap: 10px; }
.bento .hero { grid-column: 1 / -1; padding: 14px 16px; }
.bento .hero .balance-num { font-size: 26px; margin-top: 8px; }
.bento .hero .progress { margin-top: 8px; }
.bento .hero .card-desc { margin-top: 6px; }
.bento .stat { padding: 16px; }
.bento .earn { grid-column: 1 / -1; padding: 14px 16px; }
.bento .earn .steps { margin: 10px 0 2px; }
.bento .btn-block { margin-top: 8px; }
.stat-num { margin-top: 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.session-time { margin-top: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.session-key { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); background: var(--bg-base); box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 8px 12px; }
.session-key svg { width: 13px; height: 13px; }
.stat-sub { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.actions-col { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.actions-two { grid-template-columns: repeat(2, 1fr); }
.actions-single { grid-template-columns: 1fr; }
.download-hero { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.download-hero-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tile-icon-lg { width: 36px; height: 36px; }
.tile-icon-lg svg { width: 17px; height: 17px; }
.download-btn { flex-shrink: 0; min-width: 140px; height: 40px; font-size: 13px; }
.action-tile { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg-elevated); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 14px; cursor: pointer; color: var(--text-primary); transition: filter 150ms ease, transform 220ms var(--ease-out); }
.action-tile:hover { filter: brightness(115%); }
.action-tile:active { transform: scale(0.98); }
.tile-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #ffffff0a; box-shadow: inset 0 0 0 1px var(--line); }
.tile-icon svg { width: 16px; height: 16px; }
.tile-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.tile-arrow { width: 15px; height: 15px; color: var(--faint); flex-shrink: 0; transition: transform 220ms var(--ease-out), color 150ms ease; }
.action-tile:hover .tile-arrow { transform: translate(2px, -2px); color: var(--text-primary); }
.settings { grid-column: 1 / -1; padding: 14px 16px; }
.setting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setting-item { display: flex; flex-direction: column; gap: 2px; background: var(--bg-base); box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; padding: 10px 12px; }
.chip-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.chip-row .mono-chip { flex: 1; min-width: 0; margin-top: 0; }
.mono-chip { margin-top: 6px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-secondary); background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-btns { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) {
  .setting-grid { grid-template-columns: 1fr; }
}
.pulse { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: currentColor; margin-right: 6px; animation: pulse 2s ease-in-out infinite; vertical-align: 1px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* login — Madium dialog width (400px), tightened */
#view-login { max-width: 400px; }
#view-login .page-head h1 { font-size: 20px; }
#view-login .card { gap: 14px; }
#view-login .rows { margin-top: 8px; }
#view-login .row { padding: 14px 0; gap: 16px; }

/* fit everything without scrolling on desktop */
#view-dash .brandline-row { margin-bottom: 8px; }
#view-dash .page-head { margin-bottom: 10px; }
#view-dash .page-head h1 { font-size: 19px; }
.dash-head p { margin-top: 2px; font-size: 12px; }
#view-dash .action-tile { padding: 12px; }
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .actions-col { grid-template-columns: 1fr; }
  .bento .hero .balance-num { font-size: 30px; }
  .download-hero { flex-direction: column; align-items: stretch; }
  .download-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .action-tile, .tile-arrow { transition: none; }
  .page { animation: none; }
  .toast { animation: none; }
  .spinner { animation-duration: 1.5s; }
}
@media (max-width: 560px) {
  .main { padding: 16px; }
  .brandline-row { flex-wrap: wrap; }
}
.brandline-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brandline-static { margin-bottom: 0; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.ghost-btn svg { width: 13px; height: 13px; }
.ghost-btn:hover { color: var(--text-primary); background: #ffffff0a; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge.success { color: var(--success); background: #6ee7a024; }
.badge.warning { color: #f5b85d; background: #f5b85d24; }
.balance-num { margin-top: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--text-primary); }
.progress { margin-top: 16px; position: relative; height: 4px; width: 100%; overflow: hidden; border-radius: 999px; background: #ffffff0f; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--text-primary); transition: width 500ms var(--ease-out); }
.card-desc { margin: 12px 0 0; font-size: 12.5px; line-height: 1.625; color: var(--text-muted); }
.provider { display: flex; flex-direction: column; gap: 16px; border-radius: 14px; background: var(--bg-base); box-shadow: inset 0 0 0 1px var(--line); padding: 16px; }
.provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.provider-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.provider-id img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.provider-text { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.steps { display: flex; align-items: center; gap: 8px; }
.step { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg-base); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.step.done { background: var(--success); color: var(--bg-base); }
.step.current { background: var(--text-primary); color: var(--bg-base); }
.step-line { position: relative; height: 1px; flex: 1; overflow: hidden; background: var(--line); }
.step-fill { position: absolute; inset: 0 auto 0 0; background: var(--success); transition: width 500ms var(--ease-out); }

/* rows: mt-3 divide-y divide-line, row py-4 */
.rows { margin-top: 12px; display: flex; flex-direction: column; }
.rows .row + .row { border-top: 1px solid var(--line); }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 16px 0; }
.row-text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.row-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.row-desc { font-size: 12.5px; line-height: 1.625; color: var(--text-muted); overflow-wrap: break-word; }
.row-action { flex-shrink: 0; padding-top: 2px; }

.spinner { display: inline-block; width: 13px; height: 13px; border-radius: 999px; border: 2px solid #0d0d0d33; border-top-color: var(--bg-base); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* toaster bottom-center */
.toaster { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  width: min(400px, calc(100vw - 2rem));
  background: var(--bg-elevated);
  padding: 10px 12px 10px 14px; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), inset 0 0 0 1px var(--line);
  font-size: 13px; animation: view-enter 0.22s var(--ease-out) both;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast .t-title { font-weight: 500; line-height: 1.375; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
