/* ═══════════════════════════════════════════
   MATHLY — auth.css
   Delte styles til login/opret/password-sider
   Indlæses efter styles.css
═══════════════════════════════════════════ */

/* ── Auth page layout ───────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

/* ── Minimal header ─────────────────────── */
.auth-header {
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cream-dark);
  background: rgba(251,248,243,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.auth-header__back {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-mid);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .2s;
  text-decoration: none;
}
.auth-header__back:hover { color: var(--teal); }

.auth-lang {
  display: flex;
  gap: .4rem;
}
.auth-lang__btn {
  font-size: .8rem;
  font-weight: 800;
  color: var(--ink-light);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1.5px solid transparent;
  transition: all .2s;
  cursor: pointer;
  background: none;
  font-family: 'Nunito', sans-serif;
  letter-spacing: .04em;
}
.auth-lang__btn:hover {
  color: var(--teal);
  border-color: rgba(29,140,114,.25);
  background: var(--teal-light);
}
.auth-lang__btn.active {
  color: var(--teal);
  border-color: rgba(29,140,114,.35);
  background: var(--teal-light);
}

/* ── Baggrundsdekoration ────────────────── */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* ── Centered main ──────────────────────── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ── Auth card ──────────────────────────── */
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--cream-dark);
  animation: fadeInUp .45s ease both;
}

.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-card__title {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .4rem;
  text-align: center;
  line-height: 1.2;
}

.auth-card__sub {
  font-size: .95rem;
  color: var(--ink-mid);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ── Alerts ─────────────────────────────── */
.auth-alert {
  display: none;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.auth-alert.visible  { display: block; }
.auth-alert--error   { background: var(--coral-light); color: var(--coral); border: 1px solid rgba(224,90,58,.2); }
.auth-alert--success { background: var(--teal-light);  color: var(--teal);  border: 1px solid rgba(29,140,114,.2); }
.auth-alert--info    { background: var(--blue-light);  color: var(--blue);  border: 1px solid rgba(37,99,235,.2); }

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-field label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink-mid);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
  padding: 12px 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  color: var(--ink);
  background: var(--cream);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  width: 100%;
}
.form-field input::placeholder { color: var(--ink-light); }
.form-field input:focus {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(29,140,114,.1);
}
.form-field input.field-error {
  border-color: var(--coral);
  background: #fff8f7;
}
.form-field input.field-error:focus {
  box-shadow: 0 0 0 3px rgba(224,90,58,.1);
}

.form-field__error {
  font-size: .79rem;
  color: var(--coral);
  font-weight: 600;
  display: none;
}
.form-field__error.visible { display: block; }

/* Password wrapper med toggle */
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 3rem !important;
}
.pw-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
  transition: color .2s;
}
.pw-toggle:hover { color: var(--teal); }

/* Glemt password link */
.forgot-link {
  font-size: .82rem;
  font-weight: 700;
  color: var(--teal);
  text-align: right;
  text-decoration: none;
  display: block;
  margin-top: .1rem;
}
.forgot-link:hover { text-decoration: underline; }

/* ── Password styrke ────────────────────── */
.pw-strength {
  margin-top: .3rem;
}
.pw-strength__bar {
  height: 4px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .25rem;
}
.pw-strength__fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width .3s ease, background .3s ease;
}
.pw-strength__fill[data-level="svag"]   { width: 33%;  background: var(--coral); }
.pw-strength__fill[data-level="ok"]     { width: 66%;  background: var(--amber); }
.pw-strength__fill[data-level="staerk"] { width: 100%; background: var(--teal);  }
.pw-strength__label {
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-light);
}

/* ── Checkbox (vilkår) ──────────────────── */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--cream-dark);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--teal);
  cursor: pointer;
}
.form-check__label {
  font-size: .85rem;
  color: var(--ink-mid);
  line-height: 1.55;
}
.form-check__label a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}
.form-check__label a:hover { text-decoration: underline; }

/* ── Submit knap ────────────────────────── */
.btn--auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: background .22s, box-shadow .22s, transform .22s;
  box-shadow: 0 4px 18px rgba(29,140,114,.30);
  margin-top: .3rem;
}
.btn--auth:hover:not(:disabled) {
  background: #16705b;
  box-shadow: 0 6px 24px rgba(29,140,114,.40);
  transform: translateY(-1px);
}
.btn--auth:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Spinner i knap */
.btn-spinner {
  display: none;
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}
.btn--auth.loading .btn-spinner { display: block; }

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

/* ── Footer link ────────────────────────── */
.auth-card__footer {
  text-align: center;
  margin-top: 1.6rem;
  font-size: .9rem;
  color: var(--ink-mid);
}
.auth-card__footer a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}
.auth-card__footer a:hover { text-decoration: underline; }

/* ── Success state ──────────────────────── */
.auth-success {
  text-align: center;
  padding: .5rem 0 1rem;
}
.auth-success__icon {
  width: 72px; height: 72px;
  background: var(--teal-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem;
  border: 2px solid rgba(29,140,114,.2);
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both;
}
.auth-success__icon--error {
  background: var(--coral-light);
  border-color: rgba(224,90,58,.2);
}
@keyframes popIn {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.auth-success h2 {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .5rem;
}
.auth-success p {
  color: var(--ink-mid);
  font-size: .95rem;
  margin-bottom: 1.5rem;
}

/* Email fremhævet i tekst */
.highlight-email {
  font-weight: 700;
  color: var(--ink);
}

/* ── Divider ────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .5rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}
.auth-divider span {
  font-size: .78rem;
  color: var(--ink-light);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Ghost knap (tilbage til login) ─────── */
.btn--ghost-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--cream-dark);
  transition: all .2s;
  font-family: 'Nunito', sans-serif;
  background: none;
  cursor: pointer;
  margin-top: 1rem;
}
.btn--ghost-auth:hover {
  color: var(--teal);
  border-color: rgba(29,140,114,.35);
  background: var(--teal-light);
}

/* ── Genasend knap ──────────────────────── */
.resend-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-family: 'Nunito', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: opacity .2s;
  text-decoration: underline;
}
.resend-btn:hover   { opacity: .75; }
.resend-btn:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }

/* ── Statisk indhold (vilkår/privatliv) ─── */
.policy-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 2rem 6rem;
}

.policy-page h1 {
  font-family: 'Lora', serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .4rem;
}

.policy-page .policy-meta {
  font-size: .85rem;
  color: var(--ink-light);
  font-weight: 600;
  margin-bottom: 3rem;
  display: block;
}

.policy-body {
  max-width: 760px;
}

.policy-body h2 {
  font-family: 'Lora', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.5rem 0 .7rem;
}

.policy-body p,
.policy-body li {
  color: var(--ink-mid);
  line-height: 1.8;
  margin-bottom: .7rem;
}

.policy-body ul {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.policy-body strong { color: var(--ink); }

.policy-body a {
  color: var(--teal);
  font-weight: 600;
}
.policy-body a:hover { text-decoration: underline; }

/* ── Dashboard ──────────────────────────── */
.dash-page {
  min-height: 100vh;
  background: var(--cream);
}

.dash-nav {
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.dash-nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-nav__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  border: 2px solid rgba(29,140,114,.2);
  flex-shrink: 0;
}

.dash-nav__name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
}

.dash-logout {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-mid);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--cream-dark);
  transition: all .2s;
}
.dash-logout:hover {
  color: var(--coral);
  border-color: rgba(224,90,58,.3);
  background: var(--coral-light);
}

.dash-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

.dash-welcome {
  margin-bottom: 3rem;
}

.dash-welcome h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .3rem;
}

.dash-welcome h1 em {
  font-style: italic;
  color: var(--teal);
}

.dash-welcome p {
  color: var(--ink-mid);
  font-size: 1.05rem;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem 1.8rem;
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
  transition: transform .22s, box-shadow .22s;
  cursor: default;
}
.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dash-card__icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
}
.dash-card__icon--teal   { background: var(--teal-light); }
.dash-card__icon--amber  { background: var(--amber-light); }
.dash-card__icon--purple { background: var(--purple-light); }

.dash-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: .3rem;
}

.dash-card p {
  font-size: .9rem;
  color: var(--ink-mid);
  margin-bottom: 1rem;
}

.dash-card__badge {
  display: inline-block;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--cream-mid);
  color: var(--ink-light);
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 520px) {
  .auth-card {
    padding: 2rem 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
  }
  .auth-main { padding: 1.5rem 1rem; }

  .dash-nav__name { display: none; }
  .dash-content { padding: 2rem 1rem 4rem; }
}
