/**
 * Orbita Area Riservata — Stylesheet v2.0.0
 * Usa i token del design system Orbita Studio (--os-*).
 * Nessuna dipendenza da framework esterni.
 */

/* ──────────────────────────────────────────────────────────────────────────
   1. NAV BUTTON — Accedi / Area Riservata nel header.php
   ────────────────────────────────────────────────────────────────────────── */

/* Pulsante outline nel nav desktop */
.os-nav__auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--os-f-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--os-white);
  border: 1px solid var(--os-rule-2);
  border-radius: var(--os-radius);
  padding: 6px 14px;
  text-decoration: none;
  transition: border-color var(--os-dur-fast) var(--os-ease),
              background   var(--os-dur-fast) var(--os-ease),
              color         var(--os-dur-fast) var(--os-ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.os-nav__auth:hover {
  border-color: var(--os-electric);
  background: rgba(0,87,255,.09);
  color: var(--os-white);
}
/* Stato autenticato — dot lime + bordo electric */
.os-nav__auth--in {
  border-color: rgba(0,87,255,.45);
  color: var(--os-electric-2);
}
.os-nav__auth--in::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--os-lime);
  border-radius: 50%;
  flex-shrink: 0;
}
.os-nav__auth--in:hover {
  border-color: var(--os-electric);
  background: rgba(0,87,255,.12);
  color: var(--os-electric-2);
}

/* Link auth nel drawer mobile */
.os-drawer__link--auth {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--os-rule);
  color: var(--os-mist);
}
.os-drawer__link--auth:hover {
  color: var(--os-electric-2);
  padding-left: 12px;
}
.os-drawer__link--in {
  color: var(--os-electric-2);
}
.os-drawer__link--in::before {
  content: '● ';
  color: var(--os-lime);
  font-size: 9px;
  vertical-align: middle;
}

/* ──────────────────────────────────────────────────────────────────────────
   2. PAGINA LOGIN — neutralizza WordPress, full dark
   ────────────────────────────────────────────────────────────────────────── */

/* Sovrascrive background chiaro del wrapper WordPress */
.oar-login-wrap,
.wp-block-group:has(> .oar-login-wrap),
.wp-block-post-content:has(.oar-login-wrap) {
  background: var(--os-ink) !important;
  padding: 0 !important;
}

.oar-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(500px, 80vh, 100dvh);
  padding: 64px var(--os-pad-x);
}

.oar-login-card {
  width: 100%;
  max-width: 460px;
  background: var(--os-night);
  border: 1px solid var(--os-rule-2);
  border-radius: 8px;
  overflow: hidden;
}

.oar-login-card__head {
  padding: 40px 40px 32px;
  border-bottom: 1px solid var(--os-rule);
}

/* ──────────────────────────────────────────────────────────────────────────
   3. TIPOGRAFIA CONDIVISA (login + dashboard)
   ────────────────────────────────────────────────────────────────────────── */

.oar-eyebrow {
  display: block;
  font-family: var(--os-f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--os-electric-2);
  margin: 0 0 12px;
  line-height: 1.4;
}

.oar-login-title {
  font-family: var(--os-f-display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--os-white);
  margin: 0 0 10px;
}
.oar-login-title em {
  font-family: var(--os-f-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--os-electric-2);
}

.oar-login-sub {
  font-family: var(--os-f-mono);
  font-size: 13px;
  color: var(--os-mist);
  margin: 0;
  line-height: 1.5;
}
.oar-domain {
  color: var(--os-white);
  opacity: 0.75;
}

/* ──────────────────────────────────────────────────────────────────────────
   4. FORM
   ────────────────────────────────────────────────────────────────────────── */

.oar-form {
  padding: 28px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.oar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oar-field label {
  font-family: var(--os-f-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--os-mist);
}

.oar-field input[type="email"],
.oar-field input[type="password"],
.oar-field input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  background: rgba(245,245,240,.04);
  border: 1px solid var(--os-rule-2);
  border-radius: var(--os-radius);
  color: var(--os-white);
  font-family: var(--os-f-mono);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color var(--os-dur-fast), box-shadow var(--os-dur-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.oar-field input::placeholder { color: rgba(138,143,168,.45); }
.oar-field input:focus {
  border-color: var(--os-electric);
  box-shadow: 0 0 0 3px rgba(0,87,255,.18);
}

.oar-hint {
  font-family: var(--os-f-mono);
  font-size: 10px;
  color: var(--os-mist);
  opacity: 0.65;
  line-height: 1.4;
}

/* ──────────────────────────────────────────────────────────────────────────
   5. MESSAGE BOX
   ────────────────────────────────────────────────────────────────────────── */

.oar-msg {
  margin: 16px 40px 0;
  padding: 11px 14px;
  font-family: var(--os-f-mono);
  font-size: 12px;
  line-height: 1.55;
  border-radius: var(--os-radius);
}
.oar-msg--error   { background: rgba(255,61,0,.10); border: 1px solid rgba(255,61,0,.30); color: #ff9e8a; }
.oar-msg--success { background: rgba(198,255,0,.08); border: 1px solid rgba(198,255,0,.25); color: var(--os-lime); }
.oar-msg--info    { background: rgba(0,87,255,.10); border: 1px solid rgba(0,87,255,.28); color: var(--os-electric-2); }

/* ──────────────────────────────────────────────────────────────────────────
   6. BOTTONI
   ────────────────────────────────────────────────────────────────────────── */

.oar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--os-radius);
  font-family: var(--os-f-mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--os-dur-fast), color var(--os-dur-fast),
              border-color var(--os-dur-fast), opacity var(--os-dur-fast);
  white-space: nowrap;
  line-height: 1;
}

/* Primary — full electric */
.oar-btn--primary {
  width: 100%;
  background: var(--os-electric);
  color: var(--os-white);
  border-color: var(--os-electric);
}
.oar-btn--primary:hover:not(:disabled) {
  background: var(--os-electric-2);
  border-color: var(--os-electric-2);
  color: var(--os-white);
}
.oar-btn--primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* Ghost — outline */
.oar-btn--ghost {
  background: transparent;
  border-color: var(--os-rule-2);
  color: var(--os-mist);
}
.oar-btn--ghost:hover {
  border-color: rgba(245,245,240,.28);
  color: var(--os-white);
}

/* Download — outline electric */
.oar-btn--download {
  background: transparent;
  border-color: rgba(0,87,255,.4);
  color: var(--os-electric-2);
  font-size: 11px;
  padding: 8px 14px;
  flex-shrink: 0;
}
.oar-btn--download:hover {
  background: var(--os-electric);
  border-color: var(--os-electric);
  color: var(--os-white);
}

/* Loading state */
.oar-btn__label, .oar-btn__spinner { display: inline-flex; align-items: center; }
.oar-btn__spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(245,245,240,.3);
  border-top-color: var(--os-white);
  border-radius: 50%;
  animation: oar-spin .65s linear infinite;
}
.oar-btn.is-loading .oar-btn__label { display: none; }
.oar-btn.is-loading .oar-btn__spinner { display: inline-flex; }
@keyframes oar-spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────────────────────────────────────
   7. DASHBOARD — layout
   ────────────────────────────────────────────────────────────────────────── */

.oar-dash {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px var(--os-pad-x) 100px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* ── Header dashboard ──────────────────────────────────────────────── */
.oar-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--os-rule);
}

.oar-dash-title {
  font-family: var(--os-f-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--os-white);
  margin: 0 0 6px;
}
.oar-dash-title em {
  font-family: var(--os-f-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--os-electric-2);
}

.oar-dash-email {
  font-family: var(--os-f-mono);
  font-size: 11px;
  color: var(--os-mist);
  margin: 0;
  letter-spacing: 0.04em;
}

.oar-logout-form { margin: 0; flex-shrink: 0; padding-top: 6px; }

/* ── Sezioni ────────────────────────────────────────────────────────── */
.oar-section { display: flex; flex-direction: column; gap: 20px; }

.oar-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--os-f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--os-mist);
  margin: 0;
}
.oar-section-label__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--os-surface);
  border: 1px solid var(--os-rule-2);
  border-radius: 50%;
  font-size: 9px;
  color: var(--os-electric-2);
  flex-shrink: 0;
}

/* ── Lista report/paper ─────────────────────────────────────────────── */
.oar-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--os-rule);
  border: 1px solid var(--os-rule);
  border-radius: 4px;
  overflow: hidden;
  list-style: none;
  margin: 0; padding: 0;
}

.oar-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--os-night);
  transition: background var(--os-dur-fast);
}
.oar-list-item:hover { background: var(--os-surface); }

.oar-list-item__info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.oar-list-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.oar-list-item__title {
  font-family: var(--os-f-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--os-white);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.oar-list-item__meta {
  font-family: var(--os-f-mono);
  font-size: 10px;
  color: var(--os-mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tag / badge testuale ──────────────────────────────────────────── */
.oar-tag {
  font-family: var(--os-f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--os-electric-2);
  background: rgba(0,87,255,.10);
  border: 1px solid rgba(0,87,255,.22);
  border-radius: 2px;
  padding: 3px 7px;
  flex-shrink: 0;
  line-height: 1.4;
  white-space: nowrap;
}
.oar-tag--mist {
  color: var(--os-mist);
  background: rgba(138,143,168,.08);
  border-color: var(--os-rule-2);
}

/* ── Empty state ────────────────────────────────────────────────────── */
.oar-empty {
  padding: 48px 32px;
  text-align: center;
  background: var(--os-night);
  border: 1px dashed var(--os-rule-2);
  border-radius: 4px;
}
.oar-empty p {
  font-family: var(--os-f-mono);
  font-size: 14px;
  color: var(--os-mist);
  margin: 0 0 6px;
  line-height: 1.65;
}
.oar-empty__sub { font-size: 12px !important; opacity: 0.7; }

/* ──────────────────────────────────────────────────────────────────────────
   8. RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 680px) {
  .oar-login-card__head { padding: 28px 24px 24px; }
  .oar-form             { padding: 20px 24px 32px; }
  .oar-msg              { margin: 12px 24px 0; }

  .oar-dash-head { flex-direction: column; gap: 16px; }
  .oar-logout-form { padding-top: 0; }

  .oar-list-item { flex-direction: column; align-items: flex-start; gap: 12px; }
  .oar-list-item__title { white-space: normal; }
  .oar-btn--download { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .os-nav__auth { display: none; } /* nascosto su mobile — il drawer ha la sua voce */
}
