/* Suroda customer portal — Brand Guide v1.
   Slate ground, Paper text, Shu reserved for detection and alert only. */

:root {
  --slate: #10161F;
  --paper: #F4F3EE;
  --shu: #C63D2F;
  --steel: #8B94A3;
  --mist: #D8D6CD;

  --bg: var(--slate);
  --bg-raised: #161D28;
  --bg-band: #1B2330;
  --ink: var(--paper);
  --ink-muted: var(--steel);
  --hairline: #2A3442;

  --max: 1120px;
  --gutter: 40px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* A class that sets display would otherwise out-specify the user-agent
   [hidden] rule and leave a hidden view on screen. */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: Manrope, Inter, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* ---- header ---- */

.site-header {
  font-family: 'Outfit', sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline);
}

.lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lockup img {
  width: 30px;
  height: 30px;
}

.wordmark {
  font-family: Manrope, Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.wordmark sup {
  font-size: 0.55em;
  letter-spacing: 0;
  vertical-align: super;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

main {
  flex: 1;
  padding: 44px 0 64px;
}

.eyebrow {
  color: var(--steel);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- signed-out ---- */

.signin-layout {
  display: grid;
  gap: clamp(32px, 7vw, 92px);
  align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 400px);
  padding: 40px 0;
}

h1 {
  margin: 20px 0 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
}

.lede {
  max-width: 46ch;
  margin: 22px 0 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.panel {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-raised);
  padding: clamp(24px, 5vw, 32px);
}

.panel h2 {
  margin: 14px 0 0;
  font-size: 1.4rem;
}

.panel p {
  margin: 14px 0 0;
  color: var(--ink-muted);
}

.google-action,
.apple-action {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

/* Apple sits directly under Google in the same provider stack — tighten the gap
   so they read as one group rather than two separated actions. */
.apple-action {
  margin-top: 10px;
}

.google-action:hover,
.apple-action:hover {
  border-color: var(--steel);
}

.google-mark,
.apple-mark {
  width: 18px;
  height: 18px;
  flex: none;
}

.panel-note {
  margin-top: 16px;
  color: var(--steel);
  font-size: 0.86rem;
}

/* ---- dashboard ---- */

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.dash-head h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-raised);
  padding: 20px;
}

.card-label {
  color: var(--steel);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-value {
  margin-top: 18px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
}

.card-value.is-pending {
  color: var(--steel);
  font-size: 1rem;
  line-height: 1.4;
}

/* A timestamp is read, not scanned like a count, so it does not take the
   display size. */
.card-value.is-timestamp {
  font-size: 1.05rem;
  line-height: 1.45;
}

.card-note {
  margin-top: 14px;
  color: var(--steel);
  font-size: 0.82rem;
}

/* Shu appears only where something needs attention. */
.card.is-alert {
  border-color: rgba(198, 61, 47, 0.55);
}

.card.is-alert .card-value {
  color: var(--shu);
}

.split {
  display: grid;
  margin-top: 16px;
  gap: 10px;
}

.split-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.split-row span:first-child {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.split-row span:last-child {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.15rem;
}

.meter {
  height: 6px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-band);
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--steel);
}

.meter-fill.is-alert {
  background: var(--shu);
}

/* ---- upload ---- */

.section-head {
  margin: 44px 0 18px;
}

.section-head h2 {
  margin-top: 8px;
  font-size: 1.4rem;
}

.upload-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-raised);
  padding: 24px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

input[type="file"] {
  flex: 1;
  min-width: 240px;
  border: 1px dashed var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink-muted);
  padding: 12px;
  font: inherit;
  font-size: 0.9rem;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: var(--bg-raised);
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.86rem;
}

.primary-action {
  min-height: 46px;
  border: 1px solid var(--shu);
  border-radius: 6px;
  background: var(--shu);
  color: var(--paper);
  cursor: pointer;
  padding: 0 22px;
  font: inherit;
  font-weight: 600;
}

.primary-action:disabled {
  border-color: var(--hairline);
  background: var(--bg-band);
  color: var(--steel);
  cursor: not-allowed;
}

.secondary-action {
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
}

.secondary-action:disabled {
  color: var(--steel);
  cursor: wait;
}

.upload-note {
  color: var(--steel);
  font-size: 0.86rem;
}

.upload-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--hairline);
  list-style: none;
}

.upload-item {
  display: grid;
  align-items: center;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, auto);
  background: var(--bg-band);
  padding: 11px 14px;
  font-size: 0.9rem;
}

.upload-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-size {
  color: var(--steel);
  font-size: 0.82rem;
}

.upload-state {
  color: var(--ink-muted);
  font-size: 0.84rem;
  text-align: right;
}

.upload-item.is-done .upload-state {
  color: var(--ink);
}

.upload-item.is-failed .upload-state {
  color: var(--shu);
}

@media (max-width: 620px) {
  .upload-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .upload-state {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* ---- messages ---- */

.message {
  min-height: 22px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.message.is-error {
  border: 1px solid rgba(198, 61, 47, 0.5);
  border-radius: 6px;
  background: rgba(198, 61, 47, 0.1);
  color: var(--shu);
  padding: 10px 12px;
}

.message.is-success {
  color: var(--ink);
}

.detail-list {
  display: grid;
  margin-top: 20px;
  gap: 10px;
}

.detail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 8px;
}

.detail span:first-child {
  color: var(--steel);
  font-size: 0.86rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--hairline);
  padding: 22px 0 30px;
  color: var(--steel);
  font-size: 0.84rem;
}

@media (max-width: 860px) {
  :root {
    --gutter: 20px;
  }

  .signin-layout {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---- devices ---- */

#device-name {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink);
  padding: 12px;
  font: inherit;
  font-size: 0.92rem;
}

#device-name::placeholder {
  color: var(--steel);
}

#device-type {
  min-height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 0.92rem;
}

.device-item {
  grid-template-columns: minmax(0, 1fr) auto minmax(140px, auto) auto;
}

.device-item.is-revoked {
  opacity: 0.55;
}

.device-item.is-revoked .upload-state {
  color: var(--shu);
}

.device-revoke {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
}

/* The credential is Shu-bordered because it is the one thing on this page that
   is irrecoverable if the customer clicks away without copying it. */
.credential-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--shu);
  border-radius: 8px;
  background: rgba(198, 61, 47, 0.08);
  padding: 18px;
}

.credential-warning {
  color: var(--ink);
  font-size: 0.9rem;
}

.credential {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--slate);
  color: var(--paper);
  padding: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  user-select: all;
}

@media (max-width: 620px) {
  .device-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* ---- profile and billing ---- */

#profile-section .detail-list {
  margin-top: 0;
}

#profile-section .detail span:last-child {
  overflow-wrap: anywhere;
  text-align: right;
}

#plan-tier,
#plan-interval {
  min-height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 0.92rem;
}

#plan-tier {
  flex: 1;
  min-width: 200px;
}

#plan-actions {
  margin-top: 4px;
}

@media (max-width: 620px) {
  #profile-section .detail {
    flex-direction: column;
    gap: 2px;
  }

  #profile-section .detail span:last-child {
    text-align: left;
  }
}

/* Auth: email/password form + verify-email view (Increment A) */
.auth-field {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-band);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
}
.auth-field:focus {
  outline: none;
  border-color: var(--steel);
}
.or-divider {
  margin: 22px 0 4px;
  color: var(--steel);
  font-size: 0.86rem;
}
.link-button {
  margin-top: 12px;
  border: none;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  text-decoration: underline;
  padding: 0;
}
.link-button:hover {
  color: var(--ink);
}

/* Cyberpunk & Glassmorphism Aesthetic Overrides */
:root {
  --sf-cyan: #00e5ff;
  --sf-magenta: #f50057;
  --sf-surface: rgba(255, 255, 255, 0.03);
  --sf-border: rgba(255, 255, 255, 0.08);
}

html, body {
  background-color: #0b0e14;
  overflow-x: hidden;
}

.shell {
  position: relative;
  z-index: 1;
}

.glow-1, .glow-2 {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  filter: blur(180px);
  z-index: 0;
  opacity: 0.3;
  pointer-events: none;
}
.glow-1 {
  top: -300px;
  left: -200px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.4) 0%, transparent 70%);
}
.glow-2 {
  bottom: -300px;
  right: -200px;
  background: radial-gradient(circle, rgba(245, 0, 87, 0.3) 0%, transparent 70%);
}

.panel, .card, .upload-panel {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  backdrop-filter: blur(20px);
  box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 32px;
  transition: transform 0.3s, border-color 0.3s;
}

.card:hover, .panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

h1#portal-title, .dash-head h1 {
  background: linear-gradient(135deg, rgb(255, 255, 255) 0%, rgb(165, 180, 252) 100%) text;
  -webkit-text-fill-color: transparent;
  font-size: 2.4rem !important; /* Toned down */
  font-weight: 700;
  letter-spacing: -0.5px;
}

.primary-action {
  background: transparent;
  border: 1px solid var(--sf-cyan);
  color: var(--sf-cyan);
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}
.primary-action:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* SPA Navigation Styling */
.app-nav {
  display: flex;
  gap: 10px;
  padding: 4px;
  border-radius: 8px;
}
.nav-btn, .nav-btn:visited {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 8px 14px !important;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem !important;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}
.nav-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
.nav-btn.active {
  color: var(--sf-cyan);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

/* Typography Tweaks */
.wordmark {
  font-size: 1.15rem !important;
}
.wordmark sup {
  font-size: 0.6em;
}

.header-side {
  font-size: 0.95rem !important;
}

.secondary-action {
  font-size: 0.95rem !important;
  min-height: 40px;
}

.card-value {
  font-size: 2.2rem !important; /* Toned down */
  font-weight: 700 !important;
  color: #fff;
  text-shadow: rgba(255, 255, 255, 0.2) 0px 0px 15px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 12px;
}

.card::after {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 0px;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--sf-cyan), transparent);
  opacity: 0.5;
}

.card:nth-child(2n)::after {
  background: linear-gradient(90deg, var(--sf-magenta), transparent);
}

.card-label {
  font-size: 0.85rem !important;
  color: var(--sf-text-secondary);
  font-weight: 500;
}
