/* Deck Studio portal. Brand values match the website (src/app/(frontend)/globals.css) and the
   we.simplify design system. Self-hosted Poppins (SIL OFL); no third-party requests (CSP). */

@font-face {
  font-family: "Poppins";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/Poppins-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Poppins";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/Poppins-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/Poppins-SemiBold.ttf") format("truetype");
}

:root {
  --blue: #29a6dd;
  --blue-700: #1f87b6;
  --blue-100: #d4edf8;
  --blue-050: #eaf6fc;
  --orange: #f28e1e;
  --orange-700: #c5731a;
  --orange-050: #fef3e5;
  --ink: #0b0b0b;
  --slate-700: #334155;
  --slate-600: #475569;
  --grey-500: #64748b;
  --grey-300: #d1d1d1;
  --border: #e2e8f0;
  --page: #f8fafc;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --success: #1fa971;
  --danger: #d6463c;
  --danger-050: #fdeeed;

  --radius-card: 14px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 18px 40px rgba(41, 166, 221, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--blue-100); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 24px; } }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
}
.eyebrow-on-dark { color: var(--blue); }
.eyebrow-error { color: var(--danger); }
.muted { color: var(--slate-600); }
.hint { font-size: 13.5px; color: var(--slate-600); }
.link-text { color: var(--blue-700); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.stack > * + * { margin-top: 16px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { cursor: progress; opacity: 0.7; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: var(--orange-700); }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--grey-300); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-small { min-height: 40px; padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-link {
  border: 0;
  background: none;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--ink); }

/* ---------- form fields ---------- */

.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--slate-700); }
.input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-input);
  background: #fff;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.input::placeholder { color: #7a7a7a; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.textarea { min-height: 200px; resize: vertical; line-height: 1.55; }

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-size: 14.5px;
  line-height: 1.5;
}
.notice-error { background: var(--danger-050); color: #9b2c24; border: 1px solid #f3c3bf; }

/* ---------- login ---------- */

.page-login { background: var(--dark); color: #fff; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-card {
  width: 100%;
  max-width: 880px;
  overflow: hidden;
  border-radius: var(--radius-card);
  border-top: 4px solid var(--orange);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: grid;
}
.login-brand {
  padding: 32px 24px;
  background: var(--dark-2);
  color: #fff;
  border-bottom: 1px solid var(--dark-3);
}
.logo-login { width: 168px; margin-bottom: 32px; }
.login-title { margin-top: 8px; font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.login-lead { margin-top: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.78); max-width: 32ch; }
.login-form-wrap { padding: 32px 24px; }
.login-form-title { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.login-form-wrap > .muted { margin-top: 4px; margin-bottom: 20px; font-size: 14.5px; }
.login-form-wrap .notice { margin-bottom: 16px; }
.login-form-wrap .btn { margin-top: 24px; }

@media (min-width: 760px) {
  .login-card { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .login-brand { padding: 48px 40px; border-bottom: 0; border-right: 1px solid var(--dark-3); display: flex; flex-direction: column; justify-content: flex-end; }
  .logo-login { margin-bottom: auto; padding-bottom: 72px; width: 184px; }
  .login-title { font-size: 44px; }
  .login-form-wrap { padding: 48px 40px; }
}

/* ---------- app header / footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.logo-header { width: 128px; flex: none; }
.brand-product {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.header-user { display: flex; align-items: center; gap: 16px; min-width: 0; }
.user { display: none; text-align: right; line-height: 1.3; min-width: 0; }
.user-name { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { display: block; font-size: 12.5px; color: var(--slate-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; flex: none; }
@media (min-width: 720px) {
  .user { display: block; max-width: 280px; }
  .logo-header { width: 148px; }
}
@media (max-width: 380px) {
  .brand-product { display: none; }
}

.site-footer { padding: 32px 0 40px; font-size: 13px; color: var(--slate-600); }

/* ---------- page ---------- */

.main { padding-top: 32px; padding-bottom: 16px; }
.intro { max-width: 680px; margin-bottom: 24px; }
.page-title { margin-top: 8px; font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--dark); }
.lead { margin-top: 12px; font-size: 16.5px; line-height: 1.6; color: var(--slate-600); }
.month-total { margin-top: 10px; font-size: 14px; color: var(--slate-600); }
@media (min-width: 720px) {
  .main { padding-top: 48px; }
  .intro { margin-bottom: 32px; }
  .page-title { font-size: 40px; }
  .lead { font-size: 18px; }
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-2);
}
.panel { padding: 24px 16px; border-top: 4px solid var(--blue); }
@media (min-width: 640px) { .panel { padding: 32px; } }
@media (min-width: 900px) { .panel { padding: 40px; } }

/* ---------- steps ---------- */

.step { margin: 0; padding: 0; border: 0; min-width: 0; }
.step + .step { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--border); }
/* Floated so the legend sits inside the fieldset rather than on its top border. */
.step-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--dark);
}
.step-legend + * { clear: both; }
.step-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-050);
  color: var(--blue-700);
  font-size: 15px;
}

/* ---------- deck type cards ---------- */

.type-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }

.type-card {
  --accent: var(--blue);
  --accent-soft: var(--blue-050);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 52px 20px 20px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-card);
  background: #fff;
  cursor: pointer;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background-color 200ms var(--ease), transform 200ms var(--ease);
}
.type-card.accent-orange { --accent: var(--orange); --accent-soft: var(--orange-050); }
.type-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.type-card:hover .type-label { color: var(--blue-700); }
.type-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.type-label { font-size: 16.5px; font-weight: 600; line-height: 1.3; color: var(--dark); transition: color 200ms var(--ease); }
.type-desc { font-size: 14px; line-height: 1.5; color: var(--slate-600); }
.type-check {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--grey-300);
  background: #fff;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.type-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.type-card:has(.type-radio:checked),
.type-card.is-selected {
  border-color: var(--accent);
  border-top-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.type-card:has(.type-radio:checked) .type-check,
.type-card.is-selected .type-check { border-color: var(--accent); background: var(--accent); }
.type-card:has(.type-radio:checked) .type-check::after,
.type-card.is-selected .type-check::after { opacity: 1; }
.type-card:has(.type-radio:focus-visible),
.type-card.has-focus {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- drop zone ---------- */

.dropzone { position: relative; }
.dropzone-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.dropzone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 2px dashed var(--blue-100);
  border-radius: var(--radius-card);
  background: var(--page);
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.dropzone-label:hover,
.dropzone.is-dragging .dropzone-label { border-color: var(--blue); background: var(--blue-050); }
.dropzone-input:focus-visible + .dropzone-label { outline: 3px solid var(--blue); outline-offset: 3px; }
.dropzone.has-file .dropzone-label { padding-block: 18px; }
.dropzone-icon {
  position: relative;
  width: 28px;
  height: 34px;
  margin-bottom: 6px;
  border: 2px solid var(--blue);
  border-radius: 4px 10px 4px 4px;
  background: #fff;
}
.dropzone-icon::before,
.dropzone-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: var(--blue);
  transform: translateX(-50%);
}
.dropzone-icon::before { top: 9px; width: 2px; height: 14px; }
.dropzone-icon::after { top: 15px; width: 14px; height: 2px; }
.dropzone-title { font-size: 15.5px; font-weight: 500; color: var(--dark); }
.dropzone-hint { font-size: 13.5px; color: var(--slate-600); }

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #fff;
}
.file-chip-name { min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; font-weight: 500; color: var(--dark); }
.file-chip-static { display: inline-flex; margin-top: 20px; background: var(--page); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey-500);
}
.divider::before,
.divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.field .hint { margin-top: 6px; }

/* ---------- actions ---------- */

#form-error { margin-top: 24px; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}
.form-actions .btn { flex: 1 1 100%; }
@media (min-width: 640px) { .form-actions .btn { flex: 0 0 auto; } }

/* ---------- status panels ---------- */

.status-panel { max-width: 680px; }
.status-panel.accent-success { border-top-color: var(--success); }
.status-panel.accent-error { border-top-color: var(--danger); }
.panel-title { margin-top: 8px; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--dark); }
.panel-title:focus { outline: none; }
.status-panel > .muted { margin-top: 12px; }
.status-panel > .cost-line { margin-top: 8px; font-size: 14.5px; }
.status-panel > .notice { margin-top: 16px; }

.progress-bar {
  position: relative;
  height: 6px;
  margin: 24px 0 20px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--blue-050);
}
.progress-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  border-radius: inherit;
  background: var(--blue);
  animation: progress-slide 1.6s var(--ease) infinite;
}
@keyframes progress-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.progress-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.progress-step {
  position: relative;
  padding-left: 36px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 24px;
  color: var(--grey-500);
  transition: color 200ms var(--ease);
}
.progress-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
}
.progress-step.is-active { color: var(--dark); }
.progress-step.is-active::before {
  border-color: var(--blue);
  border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}
.progress-step.is-done { color: var(--slate-700); }
.progress-step.is-done::before { border-color: var(--blue); background: var(--blue); }
.progress-step.is-done::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .type-card:hover { transform: none; }
  .btn:active { transform: none; }
  .progress-bar-fill { width: 100%; animation: none; transform: none; opacity: 0.5; }
  .progress-step.is-active::before { animation: none; border-right-color: var(--blue); background: var(--blue-100); }
}
