/* ============================================================
   KinetoLife · Stiluri comune ecrane de autentificare
   Folosit de: index.php (login), forgot.php, reset.php
   ============================================================ */
:root {
  /* Paleta Medicală Teal & Mentă */
  --principal: #0F766E;
  --principal-clar: #2DD4BF;
  --principal-adanc: #115E59;
  --principal-noapte: #134E4A;
  
  --accent: #10B981;
  --accent-adanc: #059669;
  
  --gri: #71717A;
  --gri-clar: #F4F4F5;
  --alb: #FFFFFF;
  
  --ease: cubic-bezier(.16,1,.3,1);
  --panel-bg: var(--alb);
  --txt: #18181B;
  --txt-soft: #71717A;
  --label: #27272A;
  --input-bg: #FAFAFA;
  --input-border: #E4E4E7;
  --input-focus-bg: #FFFFFF;
  --btn-bg: var(--principal-adanc);
  --btn-txt: #FFFFFF;
}

html[data-theme="dark"] {
  --panel-bg: #09090B;
  --txt: #FAFAFA;
  --txt-soft: #A1A1AA;
  --label: #D4D4D8;
  --input-bg: #18181B;
  --input-border: #27272A;
  --input-focus-bg: #27272A;
  --btn-bg: var(--accent);
  --btn-txt: #064E3B;
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html, body { height: 100% }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--txt); background: var(--principal-noapte); -webkit-font-smoothing: antialiased }
.shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh }

.theme-btn {
  position: fixed; top: 18px; right: 20px; z-index: 10; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.10); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px);
  transition: transform .2s var(--ease), background .2s
}
.theme-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.18) }
html[data-theme="light"] .theme-btn { color: var(--principal-adanc); border-color: rgba(17, 94, 89, .18); background: rgba(17, 94, 89, .06) }
html[data-theme="light"] .theme-btn:hover { background: rgba(17, 94, 89, .12) }
html[data-theme="light"] .theme-btn .moon { display: none }
html[data-theme="dark"] .theme-btn .sun { display: none }

/* ---------- BRAND PANEL ---------- */
.brand {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, #14b8a6 0%, var(--principal-adanc) 45%, var(--principal-noapte) 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; isolation: isolate
}
.coil { position: absolute; inset: 0; z-index: -1; opacity: .4 } /* Opacitate redusă pentru lizibilitate */
.coil path { fill: none; stroke: url(#kgrad); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 6 10; animation: flow 14s linear infinite }
@keyframes flow { to { stroke-dashoffset: -320 } }
.glow {
  position: absolute; width: 520px; height: 520px; right: -160px; top: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, .24), transparent 62%); z-index: -1; filter: blur(8px)
}

.brand-top { display: flex; align-items: center; gap: 14px }
.logo-badge {
  height: 64px; padding: 9px 18px; border-radius: 14px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.5);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease)
}
.logo-badge:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.5) }
.logo-badge img { height: 44px; width: auto; display: block }

.brand-mid { max-width: 460px; animation: rise .7s var(--ease) both .1s }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 22px; display: flex; align-items: center; gap: 10px }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent) }
.brand h1 { font-family: 'Sora'; font-weight: 800; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 18px }
.brand h1 em { font-style: normal; color: var(--accent) }
.brand p { color: rgba(255,255,255,0.85); font-size: 15.5px; line-height: 1.65; max-width: 410px } /* Contrast mai bun */

.brand-stats { display: flex; gap: 34px; margin-top: 6px; animation: rise .7s var(--ease) both .2s }
.stat .n { font-family: 'Sora'; font-weight: 700; font-size: 22px; color: #fff }
.stat .l { font-size: 12.5px; color: rgba(255,255,255,0.7); margin-top: 2px } /* Contrast mai bun */
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

/* ---------- FORM PANEL ---------- */
.panel { background: var(--panel-bg); display: flex; align-items: center; justify-content: center; padding: 48px 40px; transition: background .3s }
.card { width: 100%; max-width: 392px; animation: rise .6s var(--ease) both .15s }
.panel-brandline { display: none; margin-bottom: 26px }
.panel-brandline img { height: 44px; width: auto }
.card-head { margin-bottom: 30px }
.card-head h2 { font-family: 'Sora'; font-weight: 700; font-size: 26px; letter-spacing: -.01em }
.card-head p { color: var(--txt-soft); font-size: 14.5px; margin-top: 8px }

.field { margin-bottom: 18px }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--label); margin-bottom: 8px }
.input-wrap { position: relative }
.input-wrap .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gri); pointer-events: none }
.field input {
  width: 100%; height: 50px; padding: 0 14px 0 42px; border: 1.5px solid var(--input-border); border-radius: 12px;
  font-size: 15px; font-family: inherit; color: var(--txt); background: var(--input-bg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s
}
.field input::placeholder { color: #A1A1AA }
.field input:focus { outline: none; border-color: var(--principal); background: var(--input-focus-bg); box-shadow: 0 0 0 4px rgba(15, 118, 110, .18) }
.toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 8px; color: var(--gri); display: grid; place-items: center; border-radius: 8px }
.toggle-pass:hover { color: var(--txt) }

/* Indicator putere parolă (reset.php) */
.pw-meter { height: 6px; border-radius: 6px; background: var(--input-border); overflow: hidden; margin: 2px 0 6px }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .25s var(--ease), background .25s }
.pw-hint { font-size: 12px; color: var(--txt-soft); min-height: 16px }

.row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 24px }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--txt-soft); cursor: pointer; user-select: none }
.remember input { width: 16px; height: 16px; accent-color: var(--principal); cursor: pointer }
.link-mic { font-size: 13px; color: var(--txt-soft); text-decoration: none; font-weight: 500 }
.link-mic:hover { color: var(--principal); text-decoration: underline }

.btn {
  width: 100%; height: 52px; border: none; border-radius: 12px; cursor: pointer; background: var(--btn-bg); color: var(--btn-txt);
  font-family: 'Sora'; font-weight: 600; font-size: 15px; letter-spacing: .01em; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s var(--ease), filter .2s, box-shadow .2s
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 12px 30px rgba(17, 94, 89, .28); transform: translateY(-1px) }
.btn:active { transform: translateY(0) }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: rot .7s linear infinite; display: none }
@keyframes rot { to { transform: rotate(360deg) } }
.btn.loading .spin { display: inline-block }
.btn.loading .label { display: none }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: 12px; font-size: 13.8px; line-height: 1.5; margin-bottom: 22px }
.alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px }
.alert.err { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA }
.alert.ok { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0 }
html[data-theme="dark"] .alert.err { background: rgba(153, 27, 27, .18); color: #FCA5A5; border-color: rgba(153, 27, 27, .4) }
html[data-theme="dark"] .alert.ok { background: rgba(6, 95, 70, .14); color: #6EE7B7; border-color: rgba(6, 95, 70, .32) }

.foot { margin-top: 28px; text-align: center; font-size: 13px; color: var(--txt-soft) }
.foot a { color: var(--principal); font-weight: 600; text-decoration: none }
.foot a:hover { text-decoration: underline }

/* Link „înapoi la login" cu săgeată */
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; color: var(--txt-soft); text-decoration: none; font-weight: 500 }
.back-link:hover { color: var(--principal) }
.back-link svg { width: 16px; height: 16px }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr }
  .brand { display: none }
  .panel { background: radial-gradient(130% 100% at 50% 0%, #14b8a6 0%, var(--principal-noapte) 60%) }
  html[data-theme="light"] .panel { background: radial-gradient(130% 100% at 50% 0%, #F4F4F5 0%, #E4E4E7 60%) }
  .card { background: var(--panel-bg); border-radius: 22px; padding: 34px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.35) }
  .panel-brandline { display: flex; align-items: center; justify-content: center }
}
@media (max-width: 420px) { .panel { padding: 24px 16px } }
@media (prefers-reduced-motion: reduce) { .coil path { animation: none } .btn, .field input, .card, .brand-mid, .brand-stats { animation: none; transition: none } }