/* ============================================================
   GIORGIA - Backoffice Aziende - Auth screens (Login/Register/ForgotPassword)
   Sand palette, split-screen layout
   ============================================================ */

*,*::before,*::after { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

/* ---------------- SAND THEME TOKENS ---------------- */
:root {
  --bg:        oklch(0.962 0.014 80);
  --bg-2:      oklch(0.930 0.018 78);
  --panel:     oklch(0.990 0.008 82);
  --panel-2:   oklch(0.960 0.014 80);
  --ink:       oklch(0.270 0.020 60);
  --ink-2:     oklch(0.440 0.018 58);
  --ink-3:     oklch(0.610 0.016 56);
  --line:      oklch(0.270 0.02 60 / 0.11);
  --line-2:    oklch(0.270 0.02 60 / 0.06);
  --accent:        oklch(0.560 0.115 45);
  --accent-deep:   oklch(0.485 0.105 42);
  --accent-soft:   oklch(0.560 0.115 45 / 0.12);
  --accent-tint:   oklch(0.930 0.030 55);
  --on-accent:     oklch(0.995 0.006 82);
  --ok:        oklch(0.560 0.10 150);
  --warn:      oklch(0.640 0.13 65);
  --shadow:    oklch(0.34 0.03 55 / 0.11);
}

/* ---------------- APP / SCREEN ---------------- */
.app { position: fixed; inset: 0; overflow: hidden; display: flex; }
.screen { flex: 1; display: flex; }

/* ---------------- BRAND ---------------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent);
  font-family: "Instrument Serif", serif; font-size: 24px; line-height: 1;
}
.brand-mark span { transform: translateY(1px); }
.brand-name { display: flex; flex-direction: column; gap: 2px; }
.wordmark {
  font-family: "Instrument Serif", serif;
  font-size: 24px; letter-spacing: 1.5px; line-height: 1; color: var(--ink);
}
.tagline { font-size: 8px; letter-spacing: 2.6px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

/* ============================================================
   LOGIN - split screen
   ============================================================ */
.login-split { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; }

.login-aside {
  position: relative; overflow: hidden;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 90% at 90% 10%, var(--accent-tint), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--line);
}
.login-aside__top { display: flex; justify-content: space-between; align-items: flex-start; }
.login-aside__art {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    repeating-linear-gradient(135deg, var(--line-2) 0 1px, transparent 1px 26px);
}
.login-headline {
  position: relative; z-index: 1; max-width: 460px;
}
.login-headline h2 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.04; letter-spacing: -.5px; margin: 0 0 20px;
  color: var(--ink); text-wrap: balance;
}
.login-headline h2 em { font-size: inherit; font-family: inherit; font-style: italic; color: var(--accent); }
.login-headline p { font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 380px; margin: 0; }
.login-aside__foot { position: relative; z-index: 1; display: flex; gap: 28px; }
.login-aside__foot div { display: flex; flex-direction: column; gap: 2px; }
.login-aside__foot b { font-family: "Instrument Serif", serif; font-size: 28px; color: var(--ink); line-height: 1; }
.login-aside__foot span { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; }

.login-main {
  display: flex; flex-direction: column;
  background: var(--bg);
}
.login-form-wrap { flex: 1; display: grid; place-items: center; padding: 24px 44px; }
.login-form { width: 380px; max-width: 100%; }
.login-form .eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.login-form h1 {
  font-family: "Instrument Serif", serif; font-weight: 400;
  font-size: 44px; line-height: 1; letter-spacing: -.5px; margin: 0 0 10px; color: var(--ink);
}
.login-form .sub { margin: 0 0 34px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; color: var(--ink-2); }
.field input {
  height: 50px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 14px; padding: 0 15px; outline: none;
  width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.forgot { display: block; text-align: right; margin: -2px 0 26px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.forgot:hover { text-decoration: underline; }
.btn-primary {
  width: 100%; height: 52px; border: none; border-radius: 11px;
  background: var(--accent); color: var(--on-accent);
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  transition: transform .14s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: 0 12px 26px -14px var(--accent-deep);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-primary:active, .btn-primary:focus, .btn-primary:active:focus {
  transform: translateY(0);
  background: var(--accent-deep); border-color: var(--accent-deep);
  color: var(--on-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-error {
  font-size: 13px; color: oklch(0.45 0.18 25); background: oklch(0.45 0.18 25 / 0.08);
  border: 1px solid oklch(0.45 0.18 25 / 0.25); border-radius: 9px;
  padding: 10px 14px; margin-bottom: 18px; line-height: 1.5;
}
.field-error:empty { display: none; padding: 0; border: 0; margin: 0; }

/* password field with show/hide toggle button (Register) */
.field-input-group { position: relative; display: flex; align-items: center; }
.field-input-group input { flex: 1; padding-right: 44px; }
.field-input-group button {
  position: absolute; right: 6px; background: none; border: none;
  padding: 6px; display: grid; place-items: center;
}
.field-input-group button img { width: 18px; height: 18px; opacity: .6; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 860px) {
  .login-split { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
