/* ── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --bg:          oklch(98% 0.01 60);     /* form chiaro, tono caldo come la landing */
  --left-bg:     oklch(24% 0.09 305);    /* viola brand */
  --surface:     oklch(100% 0 0);        /* input bianchi */
  --border:      oklch(90% 0.012 60);    /* bordo chiaro */
  --text:        oklch(26% 0.07 305);    /* viola profondo (landing #2C0E4A) */
  --text-muted:  oklch(52% 0.02 300);    /* grigio-viola */
  --orange:      oklch(62% 0.20 40);     /* arancio landing #E8500A */
  --radius:      12px;
  --font:        'Geist', system-ui, sans-serif;
}

/* ── BASE ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

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

.hidden { display: none !important; }

/* ── SHELL ───────────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44% 56%;
}

/* ── LEFT PANEL ──────────────────────────────────────────────────────────── */
.auth-left {
  position: relative;
  overflow: hidden;
  background: var(--left-bg);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-logo-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.auth-left-inner {
  position: relative;
  z-index: 2;
}

.auth-wordmark-icon {
  display: block;
  width: 280px;
  height: 280px;
  object-fit: contain;
}
.auth-brand-name {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.auth-pitch {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 20px;
}

.auth-pitch em {
  color: var(--orange);
  font-style: normal;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 280px;
}

/* animated 3D field (Three.js) */
.auth-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}
.auth-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 30% -10%, oklch(62% 0.17 40 / 0.18), transparent 55%),
    linear-gradient(180deg, transparent 38%, oklch(15% 0.012 32 / 0.62));
}

/* decorative rings */
.auth-deco {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
}
.deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--orange);
}
.deco-ring-1 { width: 500px; height: 500px; top: -220px; right: -200px; opacity: 0.06; }
.deco-ring-2 { width: 340px; height: 340px; top: -140px; right: -120px; opacity: 0.09; }
.deco-ring-3 { width: 180px; height: 180px; top: -60px;  right: -40px;  opacity: 0.14; }
.deco-dot {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.35;
  bottom: 52px; right: 48px;
}

/* ── RIGHT PANEL ──────────────────────────────────────────────────────────── */
.auth-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  min-height: 100vh;
}

.auth-form-wrap {
  width: 100%;
  max-width: 380px;
}

/* invito (R08): banner sopra le tab quando si arriva da un link di invito */
.auth-invite {
  background: oklch(62% 0.17 40 / 0.10);
  border: 1px solid oklch(62% 0.17 40 / 0.30);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 22px;
}
.auth-invite strong { color: var(--orange); }

/* mobile-only brand shown when left panel is hidden */
.auth-mobile-brand {
  display: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 32px;
}
.auth-mobile-brand span { color: var(--orange); }

/* ── TABS ────────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.auth-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px 10px 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active            { color: var(--text); border-bottom-color: var(--orange); }
.auth-tab:not(.active):hover { color: var(--text); }

/* ── FORM ────────────────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.75;
}

input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=tel],
input[type=number],
input[type=search],
input[type=url],
textarea {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  color:         var(--text);
  font-family:   var(--font);
  font-size:     14px;
  padding:       11px 14px;
  outline:       none;
  width:         100%;
  transition:    border-color 0.15s, box-shadow 0.15s;
}

input::placeholder         { color: oklch(38% 0.008 250); }
input:focus                { border-color: var(--orange); box-shadow: 0 0 0 3px oklch(62% 0.17 40 / 0.14); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(0.5); }

/* ── BUTTON ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  width:           100%;
  background:      var(--orange);
  border:          none;
  border-radius:   var(--radius);
  color:           oklch(98% 0.005 60);
  font-family:     var(--font);
  font-size:       14px;
  font-weight:     600;
  padding:         13px 24px;
  cursor:          pointer;
  letter-spacing:  0.01em;
  transition:      background 0.15s, transform 0.1s;
}
.btn-primary:hover    { background: oklch(65% 0.17 40); }
.btn-primary:active   { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── ERROR / FOOTER ──────────────────────────────────────────────────────── */
.auth-error {
  font-size:  13px;
  color:      oklch(65% 0.2 25);
  min-height: 18px;
  line-height: 1.4;
}

.auth-footer {
  margin-top: 36px;
  font-size:  12px;
  color:      oklch(36% 0.007 250);
  text-align: center;
}
.auth-footer a            { color: var(--text-muted); text-decoration: none; }
.auth-footer a:hover      { color: var(--text); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .auth-shell              { grid-template-columns: 1fr; }
  .auth-left               { display: none; }
  .auth-right              { justify-content: flex-start; padding: 52px 28px 40px; min-height: 100vh; }
  .auth-mobile-brand       { display: block; }
  .auth-form-wrap          { max-width: 100%; }
  .form-row                { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-right { padding: 40px 20px 32px; }
}


/* ── Select moderne: rimuove l'aspetto nativo, chevron custom ─────────── */
select {
  -webkit-appearance: none;
  appearance: none;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  color:         var(--text);
  font-family:   var(--font);
  font-size:     14px;
  padding:       11px 42px 11px 14px;
  width:         100%;
  outline:       none;
  cursor:        pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition:    border-color 0.15s, box-shadow 0.15s;
}
select:hover  { border-color: var(--text-muted); }
select:focus  { border-color: var(--orange); box-shadow: 0 0 0 3px oklch(62% 0.17 40 / 0.14); }
select option { color: var(--text); background: var(--surface); }

/* ── Chevron custom forzato su OGNI select (batte stili inline e classi) ── */
select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 42px !important;
  cursor: pointer;
}

/* ── Restyle: sintonia con landing/dashboard (viola brand + arancio) ─────── */
.auth-left {
  background: linear-gradient(160deg, #61527C 0%, #796693 55%, #9C89B6 130%) !important;
}
.auth-left .auth-pitch      { color: #ffffff; }
.auth-left .auth-sub        { color: rgba(255,255,255,0.72); }
.auth-left .auth-brand-name { color: #F9A552; }
.auth-left .auth-pitch em   { color: #F9A552; }

/* Link "torna al sito" in cima al pannello form */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .15s, gap .15s;
}
.auth-back:hover { color: var(--orange); gap: 10px; }
.auth-back svg   { width: 16px; height: 16px; }
