/* ==========================================================================
   Opscadia — auth.css  (login + registrazione B2B)
   Light theme, consistent with pricing.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --purple:       #7c3aed;
  --purple-dark:  #6d28d9;
  --purple-light: #8b5cf6;
  --text:         #0f0e1a;
  --text-muted:   rgba(15,14,26,0.55);
  --surface:      #fff;
  --border:       rgba(0,0,0,0.10);
  --border-focus: rgba(124,58,237,0.55);
  --error:        #dc2626;
  --success:      #16a34a;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: #f5f3ff;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139,92,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 110%, rgba(99,102,241,0.07) 0%, transparent 55%);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ── Site header overrides for light page ── */
.site-header { background: rgba(245,243,255,0.85) !important; }
.site-header.is-scrolled { background: rgba(245,243,255,0.97) !important; }
.nav-link { color: var(--text) !important; }
.brand__chip { background: transparent !important; }

/* ── Main layout ── */
.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 64px;
}

/* ── Auth card ── */
.auth-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 4px 40px rgba(124,58,237,0.08), 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.02);
}

.auth-tab {
  flex: 1;
  padding: 16px;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s;
  position: relative;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--purple);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.auth-tab.is-active {
  color: var(--purple);
}

.auth-tab.is-active::after {
  transform: scaleX(1);
}

/* ── Panels ── */
.auth-panel {
  padding: 32px;
}

.auth-panel__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text);
}

.auth-panel__sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.auth-panel__sub strong {
  color: var(--purple);
}

/* ── Form ── */
.auth-form { display: flex; flex-direction: column; gap: 0; }

.auth-section {
  margin-bottom: 24px;
}

.auth-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.auth-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.auth-field input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.auth-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.auth-field input.is-error {
  border-color: var(--error);
}

.auth-field__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-field__error {
  font-size: 0.75rem;
  color: var(--error);
  display: none;
}

.auth-field.has-error .auth-field__error { display: block; }
.auth-field.has-error input { border-color: var(--error); }

/* ── Checkbox consent ── */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-consent input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--purple);
  width: 16px; height: 16px;
}

/* ── Submit button ── */
.auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit:hover { background: var(--purple-dark); box-shadow: 0 4px 16px rgba(124,58,237,0.35); }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Spinner inside button */
.auth-submit__spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.auth-submit.is-loading .auth-submit__spinner { display: block; }
.auth-submit.is-loading .auth-submit__label { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alert banner ── */
.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.auth-alert.is-visible { display: block; }
.auth-alert--error { background: rgba(220,38,38,0.08); color: var(--error); border: 1px solid rgba(220,38,38,0.2); }
.auth-alert--success { background: rgba(22,163,74,0.08); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }

/* ── Divider ── */
.auth-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Footer link ── */
.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 20px;
}
.auth-footer a {
  color: var(--purple);
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 520px) {
  .auth-main { padding: 100px 12px 48px; }
  .auth-panel { padding: 24px 20px; }
  .auth-row { grid-template-columns: 1fr; }
}
