/* ============================================================
   GevAI Portal — derived from the GevAI Design Language v1.0.0
   (see design-language/GUIDELINES.md + gevai.tokens.css, the
   canonical kit that lives in this repository).  Generated
   output: change the kit first, then re-derive this file.

   Teal-tinted light canvas, white cards, two colors only
   (petrol teal + brass gold) and radical text economy: cards
   show icon + name; descriptions reveal on hover; navigation is
   iconic.  RTL Hebrew-first.  No JavaScript, no inline styles
   (the portal's CSP has no 'unsafe-inline').
   ============================================================ */

:root {
  /* Canvas — a whisper of teal, never flat white */
  --canvas: #f4f8f8;
  --card: #ffffff;

  /* Ink */
  --ink: #16181a;
  --gray: #5f6368;
  --gray-soft: #9aa0a6;
  --hairline: #e4eaea;
  --border: #d5dddd;

  /* Color 1 — deep GevAI teal (lead) */
  --teal: #0b6b75;
  --teal-bright: #17a2a0;
  --teal-deep: #084f57;
  --teal-container: #d6edef;

  /* The single warm accent — brass gold, tiny doses only */
  --gold: #c08b2f;

  /* The signature gradient — petrol into brass (keyline only) */
  --grad: linear-gradient(120deg, var(--teal) 0%, var(--gold) 100%);

  /* Shape + elevation */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 14px;
  /* Neutral soft shadows — quiet depth, no color cast */
  --shadow-1: 0 1px 2px rgba(22, 24, 26, 0.05), 0 3px 10px rgba(22, 24, 26, 0.05);
  --shadow-3: 0 4px 10px rgba(22, 24, 26, 0.06), 0 16px 36px rgba(22, 24, 26, 0.1);
  --shadow-float: 0 6px 14px rgba(22, 24, 26, 0.05), 0 26px 52px rgba(22, 24, 26, 0.14);

  --font-ui: "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-latin: "Space Grotesk", "Heebo", sans-serif;

  /* Motion — one curve, short durations, zero gimmicks */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 0.16s;
  --t-med: 0.4s;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Off-canvas holder for shared SVG definitions.  A class, not an inline
   style attribute: the portal's Content-Security-Policy has no
   'unsafe-inline', so inline styles would simply be dropped. */
.svg-defs { position: absolute; width: 0; height: 0; }

/* ---------- Brand ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-latin);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teal);
  text-decoration: none;
}

.spark path { fill: var(--gold); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 36px;
  background: rgba(244, 248, 248, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228, 234, 234, 0.7);
}

.topbar .wordmark { font-size: 21px; }

.user-zone { display: flex; align-items: center; gap: 16px; }

/* Logout stays a POST form — it must not add a box of its own */
.user-zone form { display: flex; margin: 0; }

.user-chip { display: flex; align-items: center; gap: 10px; }

.avatar {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal-container);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 700;
}

.user-name { font-size: 14px; font-weight: 500; color: var(--ink); }

.btn-ghost {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.btn-ghost:hover { background: #ffffff; border-color: var(--gray-soft); }

/* ---------- Layout ---------- */

.container {
  max-width: 1060px;
  margin-inline: auto;
  padding: 0 32px 88px;
}

.hero { padding: 72px 0 44px; }

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 4.8vw, 58px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--ink);
}

/* Brass full stop — one warm character */
.accent { color: var(--gold); }

.hero.compact { padding: 20px 0 40px; }
.hero.compact h1 { font-size: clamp(32px, 4vw, 46px); }

/* ---------- Back — arrow only ---------- */

.back-chip {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.back-chip:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  transform: translateX(3px);
}

/* ---------- Cards — icon + name; text reveals on hover ---------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  min-height: 208px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

/* The float: the card comes toward you — grows and lifts off the page.
   Only navigable cards move; an unavailable tile stays put (see below). */
a.card:hover {
  transform: translateY(-6px) scale(1.08);
  border-color: #c9dcde;
  box-shadow: var(--shadow-float);
}

.card h2 {
  margin: 0;
  font-size: 21.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  position: relative;
}

/* The quiet reveal: description appears only when you're on the card */
.card .desc {
  margin: 0;
  font-size: 14.5px;
  color: var(--gray);
  line-height: 1.55;
  position: relative;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}

a.card:hover .desc,
a.card:focus-visible .desc {
  opacity: 1;
  transform: none;
}

/* Touch screens have no hover — keep the text visible there */
@media (hover: none) {
  .card .desc { opacity: 1; transform: none; }
}

/* Gradient icon tiles — squircle that relaxes into a circle on hover */
/* Icon tiles — petrol green lead, gold middle, one black anchor */
.icon-tile {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0e7c87 0%, #12938a 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -8px rgba(11, 107, 117, 0.45);
  transition: border-radius var(--t-med) var(--ease);
}

.icon-tile.gold {
  background: linear-gradient(135deg, #d9a03f 0%, #b87d18 100%);
  box-shadow: 0 8px 20px -8px rgba(201, 143, 45, 0.45);
}

.icon-tile.ink {
  background: linear-gradient(135deg, #2a2e31 0%, #16181a 100%);
  box-shadow: 0 8px 20px -8px rgba(22, 24, 26, 0.45);
}

/* Extension tone from the design language, for a 4th tile */
.icon-tile.terra {
  background: linear-gradient(135deg, #cf6a44 0%, #ad4a28 100%);
  box-shadow: 0 8px 20px -8px rgba(194, 90, 56, 0.45);
}

a.card:hover .icon-tile { border-radius: 50%; }

/* ---------- Unavailable tiles — no permission / coming soon ----------
   Color is reserved for what you can actually use, so a tile you cannot
   open is drained of it: flat neutral icon tile, grey title, no elevation,
   nothing that moves.  It reads as "not yours", not as an error — and it
   is a <div>, so it is neither focusable nor navigable. */

.card--locked {
  box-shadow: none;
  cursor: default;
}

.card--locked h2 { color: var(--gray); }

.card--locked .icon-tile {
  background: var(--hairline);
  color: var(--gray);
  box-shadow: none;
}

/* Where an open card reveals a description on hover, an unavailable one
   states its status — always visible, quiet. */
.card-status {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--gray);
  position: relative;
}

/* Featured card — one primary service */
.cards-grid.featured { grid-template-columns: 1fr; max-width: 720px; }

.card--featured {
  flex-direction: row;
  align-items: center;
  gap: 28px;
  padding: 36px 40px;
  min-height: 0;
  border-radius: var(--radius-xl);
}

.card--featured .icon-tile { width: 74px; height: 74px; border-radius: 24px; flex-shrink: 0; }
.card--featured .icon-tile svg { width: 36px; height: 36px; }

.card--featured .card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; position: relative; }
.card--featured h2 { font-size: 27px; }

@media (max-width: 640px) {
  .card--featured { flex-direction: column; align-items: flex-start; gap: 16px; padding: 28px; }
}

/* ---------- Login — centered, quiet two-color presence ---------- */

.login-wrap {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  /* Ultra-soft diagonal wash: teal light from one corner, the faintest
     golden warmth from the other. No shapes, no edges. */
  background:
    linear-gradient(160deg, rgba(14, 124, 135, 0.06) 0%, rgba(244, 248, 248, 0) 46%, rgba(201, 143, 45, 0.04) 100%),
    var(--canvas);
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(430px, 100%);
  padding: 48px 44px 40px;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
}

/* Two-color keyline across the card's top edge */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--grad);
}

.brand { text-align: center; margin-bottom: 32px; }

.brand .wordmark { font-size: 34px; justify-content: center; }
.brand .wordmark .spark { width: 27px; height: 27px; }

.brand .tagline {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--gray);
}

.field { display: block; margin-bottom: 16px; }

.field span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: #e9f0f0;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.field input:hover { background: #e2ebeb; }

.field input:focus {
  background: #ffffff;
  border-color: var(--teal);
}

.btn-primary {
  width: 100%;
  margin-top: 14px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn-primary:hover {
  background: var(--teal-deep);
  box-shadow: 0 10px 24px -10px rgba(8, 79, 87, 0.55);
  transform: translateY(-2px) scale(1.05);
}
.btn-primary:active { transform: scale(0.99); }

/* Login / form error message, above the first field:
   <p class="form-alert">שם משתמש או סיסמה שגויים.</p> */
.form-alert {
  display: block;
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: #fdeeee;
  color: #b3261e;
  font-size: 13.5px;
  font-weight: 500;
}

/* ---------- Page footer ---------- */

.page-foot {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--gray-soft);
}

/* ---------- Entrance motion — one gentle rise, staggered ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.rise { animation: rise var(--t-med) var(--ease) both; }
.rise.d1 { animation-delay: 0.05s; }
.rise.d2 { animation-delay: 0.1s; }
.rise.d3 { animation-delay: 0.15s; }
.rise.d4 { animation-delay: 0.2s; }

/* ---------- Focus visibility (keyboard) ---------- */

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .rise { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
  .card, .card .desc, .icon-tile, .back-chip, .btn-primary { transition: none !important; }
  .card .desc { opacity: 1; transform: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .topbar { padding: 12px 20px; }
  .user-name { display: none; }
  .container { padding-inline: 20px; }
  .hero { padding-top: 48px; }
  .login-card { padding: 38px 26px 32px; }
}
