/* Call page of Lioran familie. Light, airy, soft shapes (docs/product/ui/2026-11-11-referintele-lui-paul/DIRECTIA.md):
   white card on a lavender-white ground, pastel orb, one primary action per state. System fonts only (CSP has no font-src);
   no inline style anywhere (style-src 'self'). Every text colour below is at least 4.5:1 on the colour it sits on
   (probe/test_pagina_live.py computes it from these tokens). */

:root {
  --fond: #f6f3ff;
  --card: #ffffff;
  --text: #1e1a3c;
  --discret: #5a5578;
  --accent: #5b3fd9;
  --pe-accent: #ffffff;
  --inchide: #b3261e;
  --pe-inchide: #ffffff;
  --eroare: #fff1ec;
  --pe-eroare: #7a2417;
  --ok: #e8f7ef;
  --pe-ok: #14573a;

  /* the orb: four stops, from the highlight to the shade */
  --orb-1: #ffffff;
  --orb-2: #e4daff;
  --orb-3: #b7a3ff;
  --orb-4: #8b6cf5;
  --halo: rgba(139, 108, 245, 0.28);

  --raza: 28px;
  --umbra: 0 18px 60px rgba(91, 63, 217, 0.12), 0 2px 8px rgba(30, 26, 60, 0.04);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(60vmax 40vmax at 100% 0%, rgba(255, 216, 196, 0.55), transparent 60%),
    radial-gradient(60vmax 40vmax at 0% 100%, rgba(196, 238, 220, 0.5), transparent 60%),
    radial-gradient(70vmax 50vmax at 0% 0%, rgba(214, 200, 255, 0.55), transparent 60%),
    var(--fond);
  -webkit-tap-highlight-color: transparent;
}

.scena {
  flex: 1;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px 8px;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: var(--raza);
  box-shadow: var(--umbra);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 7.4vw, 36px);
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------ the orb */

.orb {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 8px 0 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, var(--orb-1) 0, var(--orb-2) 24%, var(--orb-3) 60%, var(--orb-4) 100%);
  box-shadow: 0 14px 34px var(--halo), inset 0 -10px 22px rgba(60, 30, 160, 0.14);
  display: grid;
  place-items: center;
  animation: plutire 6s ease-in-out infinite;
}

.bare {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 56px;
  opacity: 0;
  transition: opacity 0.25s;
}

.bare i {
  display: block;
  width: 9px;
  height: 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  transform-origin: center;
}

/* the orb during the call */
body[data-stare="in_convorbire"] .bare,
body[data-stare="conectare"] .bare {
  opacity: 1;
}

body[data-mod="vorbeste"] .bare i {
  animation: bara 0.9s ease-in-out infinite;
}
body[data-mod="vorbeste"] .bare i:nth-child(2) { animation-delay: -0.2s; }
body[data-mod="vorbeste"] .bare i:nth-child(3) { animation-delay: -0.45s; }
body[data-mod="vorbeste"] .bare i:nth-child(4) { animation-delay: -0.1s; }
body[data-mod="vorbeste"] .bare i:nth-child(5) { animation-delay: -0.6s; }

body[data-mod="asculta"] .orb::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid var(--halo);
  animation: respira 2.6s ease-out infinite;
}

body[data-stare="conectare"] .orb::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  animation: roteste 1s linear infinite;
}

/* the end: mint orb with a check; a failure: peach orb with an exclamation mark */
body[data-stare="incheiat"] {
  --orb-1: #ffffff;
  --orb-2: #d9f5e6;
  --orb-3: #8ddab2;
  --orb-4: #4dbb86;
  --halo: rgba(77, 187, 134, 0.3);
}

body[data-stare="eroare"] {
  --orb-1: #ffffff;
  --orb-2: #ffe4d9;
  --orb-3: #ffb99c;
  --orb-4: #f28a63;
  --halo: rgba(242, 138, 99, 0.3);
}

body[data-stare="incheiat"] .orb,
body[data-stare="eroare"] .orb {
  animation: none;
}

body[data-stare="incheiat"] .orb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 50px;
  border: solid #fff;
  border-width: 0 9px 9px 0;
  border-radius: 3px;
  transform: translate(-58%, -66%) rotate(45deg);
}

body[data-stare="eroare"] .orb::before {
  content: "";
  position: absolute;
  top: 34px;
  width: 11px;
  height: 46px;
  border-radius: 7px;
  background: #fff;
}

body[data-stare="eroare"] .orb::after {
  content: "";
  position: absolute;
  bottom: 34px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
}

/* --------------------------------------------------------------- the texts */

.stare {
  display: none;
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.ceas {
  display: none;
  margin: -6px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--discret);
  font-variant-numeric: tabular-nums;
}

/* The message is always rendered (an element that appears with its text is easily missed by a screen reader); empty, it has no
   height, and its negative margins take back the two gaps of the card. */
.mesaj {
  margin: 0;
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  font-size: 18px;
  line-height: 1.45;
}

.mesaj:empty {
  padding: 0;
  margin: -7px 0;
}

.mesaj:focus {
  outline: none;
}

body[data-stare="conectare"] .stare,
body[data-stare="in_convorbire"] .stare,
body[data-stare="in_convorbire"] .ceas {
  display: block;
}

body[data-stare="incheiat"] .mesaj {
  background: var(--ok);
  color: var(--pe-ok);
}

body[data-stare="eroare"] .mesaj {
  background: var(--eroare);
  color: var(--pe-eroare);
}

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

.actiuni {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.buton {
  display: none;
  width: 100%;
  max-width: 360px;
  min-height: 64px;
  padding: 14px 24px;
  border: 0;
  border-radius: 22px;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.005em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s;
}

.buton:active {
  transform: scale(0.98);
}

.buton:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.buton-start {
  background: var(--accent);
  color: var(--pe-accent);
  box-shadow: 0 10px 26px rgba(91, 63, 217, 0.32);
}

.buton-start:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.buton-inchide {
  background: var(--inchide);
  color: var(--pe-inchide);
  box-shadow: 0 10px 26px rgba(179, 38, 30, 0.26);
}

body[data-stare="pregatit"] .buton-start,
body[data-stare="conectare"] .buton-start,
body[data-stare="eroare"][data-motiv="microfon"] .buton-start,
body[data-stare="eroare"][data-motiv="conexiune"] .buton-start,
body[data-stare="in_convorbire"] .buton-inchide {
  display: block;
}

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

.subsol {
  padding: 14px 24px max(20px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: var(--discret);
}

/* -------------------------------------------------------------- animations */

@keyframes plutire {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes respira {
  0% { transform: scale(0.96); opacity: 0.9; }
  100% { transform: scale(1.14); opacity: 0; }
}

@keyframes roteste {
  to { transform: rotate(360deg); }
}

@keyframes bara {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(3.4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 600px) {
  .card {
    padding: 44px 48px 40px;
    gap: 18px;
  }
  .orb {
    width: 176px;
    height: 176px;
  }
}

@media (max-height: 640px) {
  .orb {
    width: 112px;
    height: 112px;
    margin: 2px 0;
  }
}
