/* ==========================================================================
   FINTERM — Theme
   A dark, phosphor-glass "trading terminal" aesthetic.
   Token system lives entirely in :root so future modules stay consistent.
   ========================================================================== */

:root {
  /* --- Palette --- */
  --bg-0: #05070a;          /* deepest background */
  --bg-1: #0b0f12;          /* panel background */
  --bg-2: #10161a;          /* raised panel / card */
  --line: #1c2a2e;          /* hairline borders */
  --line-bright: #2a3f42;

  --ink-0: #cfe8db;         /* primary text (soft phosphor white-green) */
  --ink-1: #7d9a91;         /* secondary text */
  --ink-2: #4d6560;         /* tertiary / dim text */

  --phosphor: #39ff8a;      /* primary accent — terminal green */
  --phosphor-dim: #1f8f52;
  --amber: #ffb000;         /* secondary accent — alert/amber */
  --red: #ff4d4d;           /* error */

  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 3px;
  --shell-max: 960px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* --- Subtle CRT scanline overlay: the one "signature" flourish --- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(57, 255, 138, 0.025) 0px,
    rgba(57, 255, 138, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Shell / layout
   ========================================================================== */

.terminal-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

/* --- Header --- */
.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
}

.term-header__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.term-header__logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--ink-0);
}

.term-header__logo .accent {
  color: var(--phosphor);
  text-shadow: 0 0 12px rgba(57, 255, 138, 0.45);
}

.term-header__tag {
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
}

.term-header__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-1);
  letter-spacing: 0.05em;
}

.term-header__clock {
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-2);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.status-dot.is-connected {
  background: var(--phosphor);
  box-shadow: 0 0 8px rgba(57, 255, 138, 0.8);
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.8);
}

/* --- Main --- */
.term-main {
  flex: 1;
  padding: 40px 0;
}

.panel {
  width: 100%;
}

/* --- Footer --- */
.term-footer {
  display: block;
  padding: 14px 0 22px;
  font-size: 11px;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  letter-spacing: 0.04em;
}

.term-footer span {
  display: block;
}

.term-footer .dim {
  color: var(--ink-2);
  margin-top: 4px;
}

/* ==========================================================================
   Boot screen
   ========================================================================== */

.boot-screen {
  max-width: 480px;
  margin: 0 auto;
  color: var(--ink-1);
  font-size: 13px;
}

.boot-line { margin: 4px 0; }

.cursor {
  display: inline-block;
  color: var(--phosphor);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ==========================================================================
   Login screen
   ========================================================================== */

.login-screen {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--phosphor), transparent 70%);
}

.login-card__eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
  margin: 0 0 12px;
}

.login-card__title {
  font-size: 22px;
  margin: 0 0 14px;
  color: var(--ink-0);
  font-weight: 600;
}

.login-card__body {
  font-size: 13px;
  color: var(--ink-1);
  margin: 0 0 26px;
  line-height: 1.6;
}

.login-card__error {
  margin-top: 16px;
  font-size: 12px;
  color: var(--red);
  border-left: 2px solid var(--red);
  padding-left: 10px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--phosphor);
  color: #04140a;
  width: 100%;
  justify-content: center;
}

.btn--primary:hover { background: #55ffa1; }

.btn--ghost {
  background: transparent;
  color: var(--ink-1);
  border-color: var(--line-bright);
  margin-top: 22px;
}

.btn--ghost:hover {
  color: var(--red);
  border-color: var(--red);
}

.ms-logo { flex-shrink: 0; }

/* ==========================================================================
   Dashboard / user card
   ========================================================================== */

.dashboard-screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.user-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.user-card__photo-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.user-card__photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-2);
  display: block;
}

.user-card__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--phosphor-dim);
  box-shadow: 0 0 14px rgba(57, 255, 138, 0.25);
  pointer-events: none;
}

.user-card__eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
  margin: 0 0 8px;
}

.user-card__name {
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--ink-0);
  font-weight: 600;
}

.user-card__email {
  font-size: 13px;
  color: var(--ink-1);
  margin: 0 0 18px;
  word-break: break-all;
}

.user-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin: 0 0 6px;
  max-width: 360px;
}

.user-card__meta-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-card__meta-row dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.user-card__meta-row dd {
  margin: 0;
  font-size: 12px;
  color: var(--ink-1);
}

.placeholder-panel {
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--ink-2);
  font-size: 12px;
}

.placeholder-panel__text { margin: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .term-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 26px 20px;
  }

  .user-card__meta {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .login-card {
    padding: 28px 22px;
  }
}

@media (max-width: 380px) {
  body { font-size: 14px; }
  .term-header__logo { font-size: 17px; }
}

/* ==========================================================================
   OneDrive panel
   ========================================================================== */

.onedrive-panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.onedrive-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.onedrive-panel__eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
  margin: 0;
}

.btn--secondary {
  background: transparent;
  color: var(--phosphor);
  border-color: var(--phosphor-dim);
}

.btn--secondary:hover {
  background: rgba(57, 255, 138, 0.08);
  border-color: var(--phosphor);
}

.onedrive-status {
  font-size: 12px;
  color: var(--ink-1);
  margin: 14px 0 0;
}

.onedrive-status.status-error { color: var(--red); }
.onedrive-status.status-ok { color: var(--phosphor); }

.onedrive-quota {
  margin-top: 20px;
}

.onedrive-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.onedrive-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--phosphor-dim), var(--phosphor));
  transition: width 0.4s ease;
}

.onedrive-quota__figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 0;
}

.onedrive-quota__figure {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onedrive-quota__figure dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.onedrive-quota__figure dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink-0);
  font-weight: 600;
}

.onedrive-folders {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.onedrive-folders__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin: 0 0 10px;
}

.onedrive-folders__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.folder-row__path { color: var(--ink-1); }

.folder-row__tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.folder-row--created .folder-row__tag {
  color: var(--phosphor);
}

@media (max-width: 640px) {
  .onedrive-panel { padding: 20px; }
  .onedrive-quota__figures { grid-template-columns: 1fr; }
  .onedrive-panel__head { flex-direction: column; align-items: flex-start; }
}
