/* ===========================================================
   EasyTime — Login Experience
   Vanilla CSS · Mobile-first · Brand color #0d7a6e
   =========================================================== */

:root {
  /* Brand */
  --brand-50:  #e6f4f1;
  --brand-100: #c7e6e0;
  --brand-200: #98d2c7;
  --brand-300: #5fb8a9;
  --brand-500: #0d7a6e;   /* Primary */
  --brand-600: #0b6a60;   /* Hover */
  --brand-700: #095952;   /* Pressed */
  --brand-800: #074740;
  --brand-900: #053731;

  /* Neutrals */
  --ink-900: #0f1a1f;
  --ink-700: #2c3a40;
  --ink-500: #5a6a72;
  --ink-400: #7e8c93;
  --ink-300: #aab4ba;
  --ink-200: #d5dbde;
  --ink-100: #e9eef0;
  --ink-50:  #f5f7f8;
  --paper:   #ffffff;
  --canvas:  #fafbfb;

  /* Status */
  --danger-500: #c0392b;
  --danger-50:  #fdecea;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 26, 31, 0.04),
               0 1px 1px rgba(15, 26, 31, 0.03);
  --shadow-md: 0 4px 16px rgba(15, 26, 31, 0.06),
               0 2px 4px rgba(15, 26, 31, 0.04);

  /* Type */
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Helvetica Neue", Helvetica, sans-serif;

  /* Layout */
  --container: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: var(--brand-500); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-500) 50%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection { background: var(--brand-100); color: var(--ink-900); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-900);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ===========================================================
   Split shell — mobile-first single column, desktop two-pane
   =========================================================== */
.split-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Brand panel (desktop only) ---------- */
.brand-panel {
  display: none; /* Hidden on mobile */
}

/* ---------- Auth panel ---------- */
.auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 5vw, 32px) var(--gutter) 24px;
  background: var(--canvas);
}
.auth-panel-top {
  display: flex;
  align-items: center;
  margin-bottom: clamp(24px, 6vw, 36px);
}

/* ---------- Brand mark (shared) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-900);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand--minimal { color: var(--ink-900); }
.brand--light  { color: #fff; }
.brand--light .brand-mark {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ---------- Auth card ---------- */
.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 16px) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-card h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--ink-900);
}
.lede {
  margin: 0 0 28px;
  font-size: 15.5px;
  color: var(--ink-500);
  line-height: 1.6;
}

/* ---------- Form ---------- */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
}
.field input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink-900);
  background: var(--paper);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input[type="email"]::placeholder { color: var(--ink-400); }
.field input[type="email"]:hover { border-color: var(--ink-300); }
.field input[type="email"]:focus {
  border-color: var(--brand-500);
  background: color-mix(in srgb, var(--brand-50) 50%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent);
  outline: none;
}
.field input[aria-invalid="true"] {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger-500) 18%, transparent);
}
.helper {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-400);
}
.field-error {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger-500);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  transition: background-color .18s ease, color .18s ease,
              border-color .18s ease, transform .08s ease,
              box-shadow .18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-500) 28%, transparent);
}
.btn-primary:hover { background: var(--brand-600); color: #fff; text-decoration: none; }
.btn-primary:active { background: var(--brand-700); }
.btn-secondary {
  background: var(--paper);
  color: var(--brand-500);
  border-color: var(--ink-200);
}
.btn-secondary:hover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: none;
  animation: spin .8s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-button {
  background: none;
  border: 0;
  padding: 6px 4px;
  color: var(--brand-500);
  font-size: 14.5px;
  font-weight: 600;
  align-self: center;
  margin-top: 6px;
}
.link-button:hover:not([disabled]) { color: var(--brand-700); text-decoration: underline; }
.link-button[disabled] { color: var(--ink-400); cursor: not-allowed; }

/* ---------- Security note ---------- */
.security-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-500);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.security-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- Support card ---------- */
.support-card {
  width: 100%;
  max-width: 440px;
  margin: 24px auto 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--ink-100);
  text-align: left;
}
.support-card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-700);
}
.support-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-500);
}

/* ---------- Confirm card ---------- */
.confirm-card { text-align: left; }
.confirm-card h1 { font-size: clamp(26px, 5vw, 30px); }
.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-50);
  color: var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.confirm-icon svg { width: 28px; height: 28px; }
.sent-to {
  display: inline-block;
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 4px 0 18px;
  word-break: break-all;
  font-size: 14.5px;
}
.support-text { margin: 0 0 12px; color: var(--ink-700); font-weight: 500; }
.muted { margin: 0 0 22px; color: var(--ink-500); font-size: 14.5px; }
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

/* ---------- Discreet footer ---------- */
.site-footer {
  width: 100%;
  max-width: 440px;
  margin: auto auto 0;
  padding: 32px 0 8px;
  text-align: center;
}
.footer-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
}
.footer-links a {
  font-size: 12.5px;
  color: var(--ink-400);
  font-weight: 500;
  padding: 6px 2px;
  letter-spacing: 0.01em;
}
.footer-links a:hover { color: var(--brand-600); text-decoration: underline; }
.footer-sep {
  color: var(--ink-300);
  font-size: 12px;
  user-select: none;
}
.site-footer--standalone {
  max-width: var(--container);
  padding: 32px var(--gutter);
  margin-top: 32px;
  border-top: 1px solid var(--ink-100);
}

/* ===========================================================
   Legal pages
   =========================================================== */
.legal-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) var(--gutter);
}
.top-bar {
  width: 100%;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--ink-100);
}
.top-bar-back {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-500);
}
.legal-article h1 {
  margin: 4px 0 14px;
  font-size: clamp(28px, 5vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 800;
}
.legal-article h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
}
.legal-article p,
.legal-article li {
  color: var(--ink-700);
  font-size: 15.5px;
  line-height: 1.65;
}
.legal-article .lede { color: var(--ink-500); font-size: 16px; }
.legal-article ul { padding-left: 22px; margin: 6px 0 12px; }
.legal-article li { margin: 6px 0; }
.legal-article .eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-500);
}

/* Cookie table */
.cookie-table {
  margin: 12px 0 8px;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper);
}
.cookie-row {
  display: grid;
  grid-template-columns: 1.1fr 2fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 14px;
}
.cookie-row:last-child { border-bottom: 0; }
.cookie-head {
  background: var(--ink-50);
  font-weight: 700;
  color: var(--ink-700);
}

/* ===========================================================
   Desktop split layout
   =========================================================== */
@media (min-width: 900px) {
  body[data-page="login"],
  body[data-page="confirm"] { background: var(--brand-900); }

  .split-shell {
    flex-direction: row;
    min-height: 100vh;
  }

  /* Brand panel becomes the left half */
  .brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 50%;
    min-width: 0;
    padding: 48px clamp(40px, 5vw, 72px);
    background:
      radial-gradient(120% 80% at 0% 0%, var(--brand-700) 0%, transparent 60%),
      var(--brand-500);
    color: #fff;
    overflow: hidden;
  }
  .brand-panel .brand {
    color: #fff;
    font-size: 18px;
    align-self: flex-start;
  }

  .brand-hero {
    margin-top: auto;
    max-width: 480px;
    position: relative;
    z-index: 1;
  }
  .brand-eyebrow {
    margin: 0 0 16px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
  }
  .brand-headline {
    margin: 0 0 28px;
    font-size: clamp(34px, 3.4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 800;
    color: #fff;
  }
  .brand-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15.5px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.45;
  }
  .brand-points svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    padding: 4px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #fff;
  }
  .brand-panel-foot {
    margin: 56px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
  }
  /* Decorative soft glow — no glassy/trendy stuff, just one quiet shape */
  .brand-panel-glow {
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-300) 28%, transparent), transparent 70%);
    pointer-events: none;
  }

  /* Auth panel: right half on white */
  .auth-panel {
    flex: 1 1 50%;
    min-width: 0;
    background: var(--paper);
    padding: 48px clamp(40px, 5vw, 72px);
    justify-content: center;
  }
  /* Hide the small logo on desktop — brand panel already shows it */
  .auth-panel-top { display: none; }

  .auth-card {
    max-width: 420px;
    margin: 0 auto;
  }
  .site-footer {
    margin: 40px auto 0;
    text-align: left;
    max-width: 420px;
  }
  .footer-links { justify-content: flex-start; }

  /* Confirm: side-by-side buttons */
  .confirm-actions { flex-direction: row; }
  .confirm-actions .btn { flex: 1; }
}

@media (min-width: 1200px) {
  .brand-panel { flex: 1 1 52%; }
  .auth-panel  { flex: 1 1 48%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Subtle entrance */
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
  .brand-hero { animation: rise .7s cubic-bezier(.2,.7,.2,1) both .1s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
