/* Data Airflow Business Card Generator — styling matched to the DAF CRO Plan site. */
:root {
  --font-display: "Zalando Sans Expanded", "Zalando Sans", system-ui, sans-serif;
  --font-body: "Zalando Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --border: #e4e7ec;
  --border-strong: #d2d7df;

  --navy: #043650;
  --navy-700: #0a4a6b;
  --blue-deep: #054a6e;
  --blue: #0077b8;

  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #5b6675;

  --danger: #b42318;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
  --shadow-lift: 0 1px 2px rgba(4, 54, 80, 0.05), 0 10px 30px -12px rgba(4, 54, 80, 0.22);

  --navy-gradient: radial-gradient(120% 140% at 85% 0%, rgba(0, 119, 184, 0.45) 0%, transparent 55%),
    linear-gradient(135deg, #043650 0%, #054a6e 60%, #066089 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--navy);
  margin: 0;
}

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

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Login (navy hero) ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--navy-gradient);
}
.login-box { width: 100%; max-width: 24rem; }
.login-box img.logo { height: 34px; width: auto; }
.login-box .eyebrow { color: rgba(255, 255, 255, 0.55); margin-top: 2rem; }
.login-box h1 { color: #fff; margin-top: 0.5rem; font-size: 1.6rem; }
.login-box p.sub { margin-top: 0.75rem; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; line-height: 1.6; }
.login-box form { margin-top: 1.75rem; }
.login-box input[type="password"] {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  color: #fff;
  font-family: inherit;
}
.login-box input::placeholder { color: rgba(255, 255, 255, 0.4); }
.login-box input:focus-visible { outline: none; border-color: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
.login-box button {
  margin-top: 1rem;
  width: 100%;
  border: 0;
  border-radius: 0.6rem;
  background: #fff;
  color: var(--navy);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.login-box button:hover { opacity: 0.9; }
.login-box .err { margin-top: 0.6rem; font-size: 0.85rem; color: #fecaca; }

/* ---------- App shell ---------- */
.appbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.appbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.appbar img.logo { height: 26px; width: auto; display: block; }
.appbar .signout { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.appbar .signout:hover { color: var(--navy); }

.wrap { max-width: 880px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.5rem; }
.page-head p { margin: 0.4rem 0 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.75rem; }
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.7rem 1rem;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--blue); }

.panel { display: none; }
.panel.active { display: block; }

/* ---------- Cards / forms ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.75rem;
}
.card h2 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.card .hint { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 1.1rem; }
.card .hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.8rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
input[type="text"], input[type="email"], input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  background: #fff;
}
input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 119, 184, 0.15); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.82rem; }
.btn-ghost { background: var(--surface-2); color: var(--navy); }
.btn-ghost:hover { background: #e8edf2; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, #fff); }

.link { display: inline-block; margin-top: 0.9rem; color: var(--blue); font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Existing cards list ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .who { min-width: 0; }
.list-row .who .name { font-weight: 600; color: var(--navy); }
.list-row .who .meta { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.1rem; }
.list-row .actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.empty { color: var(--text-dim); font-size: 0.92rem; padding: 0.5rem 0; }
.count { color: var(--text-dim); font-size: 0.82rem; font-weight: 600; }

/* ---------- Loading spinner + form status ---------- */
.btn.loading { cursor: progress; opacity: 0.9; }
.btn.loading::before {
  content: "";
  width: 0.95em;
  height: 0.95em;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { margin: 0.85rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.form-status.ok { color: var(--navy); }
.form-status.err { color: var(--danger); white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  .btn.loading::before { animation: none; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .list-row { flex-direction: column; align-items: flex-start; }
}
