/**
 * ADP — Tema login Keycloak | hub Agrilogistics (Smart e-Agrilogistics Hub)
 * Stile del mockup "Welcome to e-AgriLogistics" (header bicolore + card + input pesca + status bar).
 * Caricato dal login.ftl standalone.
 *
 * Accento brand = VARIABILE: cambia --adp-accent.
 *   arancio mockup:      #ea580c
 *   verde design system: #15803d (ADP-76 / packages/ui .theme-agrilogistics)
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root,
body.adp-login {
  /* marker ADP-76 (test ATDD) — non rimuovere */
  --adp-primary: #15803d;
  --adp-primary-foreground: #ffffff;

  /* palette mockup agri (caldo) */
  --adp-bg: #faf3ee;
  --adp-card: #ffffff;
  --adp-ink: #1a1512;
  --adp-text: #6f6760;
  --adp-muted: #a3938a;
  --adp-input-bg: #f6dccb;       /* pesca pieno */
  --adp-input-ink: #5c4636;
  --adp-input-icon: #c08862;
  --adp-line: #ece2da;

  /* accento (arancio mockup) */
  --adp-accent: #ea580c;
  --adp-accent-strong: #c2410c;
  --adp-accent-soft: rgba(234, 88, 12, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.adp-login {
  min-height: 100vh;
  background: var(--adp-bg);
  color: var(--adp-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.adp-page {
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: 48px 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ===== Header sopra la card ===== */
.adp-head { margin-bottom: 26px; }
.adp-badge {
  display: inline-block; margin-bottom: 16px;
  padding: 6px 12px; border-radius: 8px;
  background: #f1e0d4; color: var(--adp-accent-strong);
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.adp-title {
  margin: 0 0 14px;
  font-size: 44px; line-height: 1.04; font-weight: 900; letter-spacing: -.02em;
  color: var(--adp-ink);
}
.adp-accent-text { color: var(--adp-accent); }
.adp-subtitle {
  margin: 0; font-size: 14px; line-height: 1.5; color: var(--adp-text);
}

/* ===== Card ===== */
.adp-card {
  width: 100%;
  background: var(--adp-card);
  border-radius: 24px;
  padding: 34px 32px 28px;
  box-shadow: 0 24px 50px -28px rgba(120, 60, 20, .30);
}

/* ===== Alert ===== */
.adp-alert {
  margin: 0 0 18px; padding: 11px 14px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; border: 1px solid transparent;
}
.adp-alert--error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.adp-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.adp-alert--warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.adp-alert--info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ===== Campi ===== */
.adp-field { margin-bottom: 22px; }
.adp-label {
  display: block; margin-bottom: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #3a322c;
}

.adp-input-wrap { position: relative; }
.adp-input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--adp-input-bg);
  border: 1px solid transparent; border-radius: 4px;
  font-size: 15px; color: var(--adp-input-ink);
  transition: box-shadow .15s, border-color .15s;
}
.adp-input::placeholder { color: #b6917c; }
.adp-input.has-left { padding-left: 44px; }
.adp-input.has-right { padding-right: 46px; }
.adp-input:focus {
  outline: none;
  border-color: var(--adp-accent);
  box-shadow: 0 0 0 3px var(--adp-accent-soft);
}
.adp-input--error { border-color: #e2562a; }

.adp-input-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center;
  color: var(--adp-input-icon); font-size: 16px; font-weight: 600;
  pointer-events: none;
}
.adp-eye {
  position: absolute; top: 0; right: 0; height: 52px; width: 46px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--adp-input-icon);
}
.adp-eye:hover { color: var(--adp-accent-strong); }
.adp-eye.is-on { color: var(--adp-accent); }

.adp-field-error {
  display: block; margin-top: 7px; font-size: 12.5px; color: #c2410c;
}

/* ===== Riga remember / forgot ===== */
.adp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 0 32px;
}
.adp-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--adp-text); cursor: pointer;
}
.adp-check input {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 20px; height: 20px; margin: 0;
  position: relative; cursor: pointer;
  background: #fff; border: 1.5px solid #e0d3c8; border-radius: 7px;
  transition: background .15s, border-color .15s;
}
.adp-check input:hover { border-color: #d2bdac; }
.adp-check input:checked { background: var(--adp-accent); border-color: var(--adp-accent); }
.adp-check input:checked::after {
  content: ""; position: absolute; left: 6.5px; top: 3px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.adp-check input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--adp-accent-soft); }

/* ===== Link ===== */
.adp-link {
  color: var(--adp-accent); font-weight: 700; text-decoration: none; font-size: 13px;
}
.adp-link:hover { color: var(--adp-accent-strong); text-decoration: underline; }

/* ===== Submit (arancio a gradiente) ===== */
.adp-submit {
  width: 100%; height: 54px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(100deg, #c2410c 0%, #ea580c 55%, #f97316 100%);
  color: #fff; border: none; border-radius: 4px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px -14px rgba(234, 88, 12, .6);
  transition: filter .15s, transform .05s;
}
.adp-submit:hover { filter: brightness(1.04); }
.adp-submit:active { transform: translateY(1px); }

/* ===== Footer card ===== */
.adp-card-footer {
  margin: 30px 0 0; text-align: center;
  font-size: 12px; color: var(--adp-muted);
}

/* ===== Status bar ===== */
.adp-status {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 4px 0;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--adp-muted);
}
.adp-status-left { display: inline-flex; align-items: center; gap: 8px; }
.adp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--adp-accent);
  box-shadow: 0 0 0 3px var(--adp-accent-soft);
}

/* ===== Focus visibile (WCAG 2.1 AA) ===== */
:focus-visible { outline: 3px solid var(--adp-accent); outline-offset: 2px; }
.adp-input:focus-visible { outline: none; }

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

@media (max-width: 420px) {
  .adp-title { font-size: 36px; }
}
