/* qubint auth + post-login shell — login, select-app, mitt-konto, app-skal.
   Tokens från tokens.css. Bakgrund + glas från dark.css. */

:root { --topbar-h: 64px; }

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

body.auth {
  background: #1f2329;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  position: relative;
}
/* Lugn mörkgrå yta utan hero-bild — subtil ljusare radiell höjdpunkt
   på toppen så pillen sticker fram. */
body.auth .bg {
  background-image: none;
}
body.auth::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at top, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0) 30%);
  pointer-events: none;
}

/* === Auth-topbar (Pattern A — minimalistisk, bara logo + Tillbaka) === */
.auth-topbar {
  position: fixed;
  top: clamp(10px, 1.2vw, 16px);
  left: clamp(10px, 1.5vw, 20px);
  right: clamp(10px, 1.5vw, 20px);
  z-index: 50;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 clamp(1.1rem, 2.4vw, 2rem);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(15,17,20,0.06);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 12px 28px rgba(15,17,20,0.08);
}
.auth-topbar a, .auth-topbar button { color: #0f1114; }
.auth-topbar .topbar-logo {
  height: 22px; width: auto; display: block;
  filter: brightness(0);
}
.auth-topbar .topbar-logo-link {
  display: inline-flex; align-items: center; text-decoration: none;
  transition: opacity 0.2s;
}
.auth-topbar .topbar-logo-link:hover { opacity: 0.7; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: 400 0.88rem/1 'Outfit', system-ui, sans-serif;
  letter-spacing: 0.005em;
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  transition: background 0.2s;
}
.back-link:hover { background: rgba(15,17,20,0.05); }
.back-link svg { width: 14px; height: 14px; stroke: currentColor; }

/* === Login-vy === */
.auth main {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(var(--topbar-h) + 2rem) clamp(1.25rem, 4vw, 3rem) 2rem;
}
.login-wrap {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 1.25rem;
  animation: fadeUp 0.8s cubic-bezier(.2,.7,.2,1);
}
.login-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.30);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex; flex-direction: column; gap: 1.25rem;
}
.login-header { display: flex; flex-direction: column; gap: 0.5rem; text-align: center; }
.login-title { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.005em; margin: 0; color: #fff; }
.login-sub { font-size: 0.92rem; font-weight: 300; line-height: 1.5; color: rgba(255,255,255,0.78); margin: 0; }

/* === Form === */
.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }
.form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; }
.form-label {
  font-size: 0.78rem; font-weight: 400;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.02em;
  padding-left: 0.1rem;
}
.form-helper {
  font-size: 0.75rem; font-weight: 400;
  color: var(--qubint-accent-light);
  text-decoration: none;
}
.form-helper:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.form-input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  background: rgba(255,255,255,0.96);
  color: #0f1114;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  font: 400 0.92rem/1.4 'Outfit', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.form-input::placeholder { color: #8a8f95; }
.form-input:focus {
  border-color: rgba(204, 255, 0,0.85);
  box-shadow: 0 0 0 3px rgba(204, 255, 0,0.18);
  background: #fff;
}
.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 2.5rem; }
.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: #5b6068;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.password-toggle:hover { color: #0f1114; background: rgba(15,17,20,0.06); }
.password-toggle svg { width: 16px; height: 16px; stroke: currentColor; }
.remember-row { display: flex; align-items: center; justify-content: space-between; margin: 0.15rem 0 0.25rem; }
.remember {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  user-select: none;
}
.remember input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.remember input[type="checkbox"]:checked {
  background: var(--qubint-accent);
  border-color: var(--qubint-accent);
}
.remember input[type="checkbox"]:checked::after {
  content: ""; position: absolute; inset: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.form-submit {
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: var(--qubint-accent);
  color: var(--qubint-bg);
  border: none;
  border-radius: 8px;
  font: 500 0.95rem/1 'Outfit', system-ui, sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: background 0.3s, transform 0.15s, box-shadow 0.3s;
}
.form-submit:hover {
  background: var(--qubint-accent-hover);
  box-shadow: 0 8px 24px rgba(204, 255, 0,0.4);
  transform: translateY(-1px);
}
.form-submit:active { transform: translateY(0); background: var(--qubint-accent-active); }

.form-error {
  background: rgba(255,107,107,0.10);
  border: 1px solid rgba(255,107,107,0.40);
  color: var(--qubint-error-strong);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.form-success {
  background: rgba(95,184,138,0.10);
  border: 1px solid rgba(95,184,138,0.45);
  color: #5fb88a;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.login-foot {
  text-align: center;
  font-size: 0.88rem; font-weight: 300;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.login-foot a { color: var(--qubint-accent-light); text-decoration: none; font-weight: 400; }
.login-foot a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Demo-snabblogin (endast dev) */
.demo-card {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.20);
  border-radius: 12px;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.demo-card-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 0.15rem;
}
.demo-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.demo-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font: 400 0.78rem/1.2 'Outfit', system-ui, sans-serif;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
}
.demo-btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.30); }
.demo-card-hint { font-size: 0.7rem; color: rgba(255,255,255,0.5); margin: 0.25rem 0 0; }

/* === Select-app === */
.switch-wrap {
  width: 100%; max-width: 740px;
  display: flex; flex-direction: column; gap: 1.5rem;
  animation: fadeUp 0.6s cubic-bezier(.2,.7,.2,1);
}
.switch-header { text-align: center; }
.switch-eyebrow {
  font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin: 0 0 0.6rem;
}
.switch-title { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 500; color: #fff; margin: 0 0 0.65rem; }
.switch-sub { font-size: 0.95rem; font-weight: 300; color: rgba(255,255,255,0.82); line-height: 1.55; max-width: 540px; margin: 0 auto; }
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.role-card {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.30);
  padding: 1.6rem 1.4rem;
  text-decoration: none; color: #fff;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.role-card:hover {
  transform: translateY(-3px);
  border-color: rgba(204, 255, 0,0.50);
  box-shadow: 0 20px 56px rgba(0,0,0,0.40);
}
.role-meta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1rem;
}
.role-meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--qubint-accent-light); }
.role-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(204, 255, 0,0.20);
  border: 1px solid rgba(204, 255, 0,0.40);
  color: var(--qubint-accent-light);
  margin-bottom: 1rem;
}
.role-icon svg { width: 24px; height: 24px; stroke: currentColor; }
.role-card-title { font-size: 1.15rem; font-weight: 500; margin: 0 0 0.5rem; }
.role-card-text { font-size: 0.9rem; font-weight: 300; line-height: 1.55; color: rgba(255,255,255,0.78); margin: 0 0 1rem; }
.role-card-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--qubint-accent-light);
  margin-top: auto;
}
.role-card-cta svg { width: 14px; height: 14px; stroke: currentColor; transition: transform 0.2s; }
.role-card:hover .role-card-cta svg { transform: translateX(3px); }
.switch-foot { text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.6); margin: 0; }
.switch-foot strong { font-weight: 400; color: rgba(255,255,255,0.85); }

@media (max-width: 640px) {
  .role-grid { grid-template-columns: 1fr; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .login-card { padding: 1.25rem 1.1rem; border-radius: 14px; }
  .login-title { font-size: 1.25rem; }
}
