/* ==========================================================================
   HAICCP — Pagine di accesso (login cliente, login admin)
   Richiede css/base.css
   ========================================================================== */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }

.auth-aside {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    padding: 40px 52px; background: var(--grad-dark); color: rgba(255,255,255,.72);
}
.auth-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%); mask-image: linear-gradient(180deg, #000, transparent 90%);
}
.auth-aside > * { position: relative; }
.auth-aside h1 { color: #fff; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; max-width: 460px; letter-spacing: -0.03em; font-weight: 700; }
.auth-aside p { max-width: 440px; margin-top: 14px; font-size: 15px; color: rgba(255,255,255,.7); }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 28px; font-size: 14px; color: #fff; }
.auth-points li { display: flex; gap: 12px; align-items: center; }
.auth-points i { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; color: var(--brand-900); background: var(--brand-300); }
.auth-aside small { font-size: 12px; color: rgba(255,255,255,.45); }

.auth-visual { display: grid; gap: 10px; max-width: 360px; }
.av-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.av-card.shift { margin-left: 28px; background: #fff; border-color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.av-card b { display: block; font-size: 13.5px; color: #fff; }
.av-card small { font-size: 12px; color: rgba(255,255,255,.6); }
.av-card.shift b { color: var(--ink); }
.av-card.shift small { color: var(--text-2); }
.av-ico { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 15px; }
.av-ico.ok { background: rgba(111,211,178,.16); color: var(--brand-300); }
.av-ico.blue { background: rgba(147,180,255,.16); color: #A9C2FF; }
.av-ico.sun { background: var(--sun-soft); color: var(--sun-ink); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .mark { display: none; margin-bottom: 24px; }
.auth-box h2 { font-size: 26px; letter-spacing: -0.03em; font-weight: 700; }
.auth-box .form-control { height: 42px; }
.auth-box .btn-primary { height: 44px; font-size: 14.5px; border-radius: 10px; }
.auth-box .lead { margin: 6px 0 22px; font-size: 13.5px; color: var(--text-2); }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 28px; background: var(--surface-3); border-radius: 12px; }
.segmented button { height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent; font: 500 13.5px var(--font-body); color: var(--text-2); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.key-input { font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.key-status { min-height: 20px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.key-status.ok { color: var(--ok); }
.key-status.error { color: var(--bad); }

.plan-preview { display: none; margin: 4px 0 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.plan-preview.visible { display: block; }
.plan-preview-header { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.plan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.plan-meta { margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.plan-features { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.plan-feat-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text); }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.consent input { margin-top: 2px; flex-shrink: 0; }

.pw-field { position: relative; }
.pw-field .form-control { padding-right: 40px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 28px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: var(--radius-sm); }
.pw-toggle:hover { color: var(--ink); background: var(--surface-3); }

.alert-msg { display: none; margin-top: 16px; }
.alert-msg.error { display: flex; }

.success-box { text-align: center; padding: 24px 0; }
.success-box .icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 18px; }
.success-box p { margin: 6px 0 20px; color: var(--text-2); }

.auth-footer { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 32px; font-size: 12px; color: var(--text-3); }
.auth-footer a { color: var(--text-2); }

.otp-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.4em; text-align: center; height: 48px; }

@media (max-width: 900px) {
    .auth-page { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { display: none; }
    .auth-box .mark { display: inline-flex; }
    .auth-page { background: var(--bg); }
    .auth-main { align-items: flex-start; padding-top: 32px; }
    .auth-box { padding: 24px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
    .auth-box > .mark { margin-bottom: 20px; }
}
