/* ─── Logotyp-komponent ─────────────────────────────────────────────────────── */

.yi-wordmark {
  font-family: var(--yi-font);
  font-size: 18px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  white-space: nowrap;
  line-height: 1.15;
  display: inline-block;
}
.yi-wordmark__your {
  font-weight: 100;
  color: #F7F4EC;
  text-shadow: 0 0 24px rgba(247,244,236,0.18);
}
.yi-wordmark__invite {
  font-weight: 300;
  background: linear-gradient(100deg, #8A6A2A 0%, #D9B95E 28%, #F6E7AE 50%, #C9A24B 72%, #7C5E24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.yi-wordmark--hero { font-size: clamp(42px, 6vw, 62px); }
.yi-logo-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.yi-logo-hero__line {
  width: min(460px, 80%);
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(90deg, transparent 0%, #C9A24B 20%, #F6E7AE 50%, #C9A24B 80%, transparent 100%);
}
.yi-wordmark--reflection {
  margin-top: 2px;
  transform: scaleY(-1);
  opacity: 0.28;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 55%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 55%);
}
.yi-wordmark--reflection .yi-wordmark__your { text-shadow: none; }

/* ─── Reset & variabler ─────────────────────────────────────────────────────── */

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

:root {
  --color-bg: #0d0d0d;
  --color-surface: #161616;
  --color-surface-2: #1e1e1e;
  --color-border: #2a2a2a;
  --color-text: #e8e8e8;
  --color-text-muted: #888;
  --color-accent: #C9A84C;
  --color-accent-hover: #dbb85a;
  --color-ja: #2d8a4e;
  --color-nej: #8a2d2d;
  --color-success: #2d8a4e;
  --color-error: #c0392b;
  --color-warning: #d4a017;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; display: block; }

/* ─── Knappar ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled, .btn--disabled { opacity: 0.4; cursor: not-allowed; }

.btn--accent { background: var(--color-accent); color: #0d0d0d; }
.btn--accent:hover:not(:disabled) { background: var(--color-accent-hover); color: #0d0d0d; }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn--danger { background: var(--color-nej); color: #fff; }
.btn--danger:hover { background: #a33; }

.btn--green { background: var(--color-ja); color: #fff; }
.btn--green:hover { background: #3aa05e; }

.btn--ja { background: var(--color-ja); color: #fff; font-size: 16px; }
.btn--ja:hover { background: #3aa05e; }

.btn--nej { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); font-size: 16px; }
.btn--nej:hover { border-color: var(--color-nej); color: #e87070; }

.btn--lg { padding: 14px 36px; font-size: 16px; }
.btn--sm { padding: 7px 16px; font-size: 13px; }
.btn--xs { padding: 4px 10px; font-size: 12px; }
.btn--full { width: 100%; justify-content: center; }
.btn--icon { gap: 8px; }
.btn--active { border-color: var(--color-accent); color: var(--color-accent); }

/* ─── Inputs ─────────────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color var(--transition);
  outline: none;
}
.input:focus { border-color: var(--color-accent); }
.input::placeholder { color: var(--color-text-muted); }
.input--lg { padding: 14px 18px; font-size: 16px; }
.input--color { padding: 4px; height: 42px; cursor: pointer; }
.input--file { padding: 8px 14px; cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; }
select.input { cursor: pointer; }

.input-group { display: flex; align-items: center; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.input-group__suffix {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.form-hint { font-size: 12px; color: var(--color-text-muted); }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-inline .input { flex: 1; min-width: 160px; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--admin    { background: rgba(201,168,76,0.2); color: var(--color-accent); border: 1px solid var(--color-accent); }
.badge--green    { background: rgba(45,138,78,0.2); color: #4ec97a; border: 1px solid rgba(45,138,78,0.4); }
.badge--red      { background: rgba(138,45,45,0.2); color: #e87070; border: 1px solid rgba(138,45,45,0.4); }
.badge--yellow   { background: rgba(212,160,23,0.2); color: #f0c040; border: 1px solid rgba(212,160,23,0.4); }
.badge--grey     { background: rgba(255,255,255,0.06); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge--subdomain { background: rgba(26,95,158,0.2); color: #6ab0f5; border: 1px solid rgba(26,95,158,0.4); font-size: 12px; }

.status--ja         { background: rgba(45,138,78,0.2); color: #4ec97a; border: 1px solid rgba(45,138,78,0.4); }
.status--nej        { background: rgba(138,45,45,0.2); color: #e87070; border: 1px solid rgba(138,45,45,0.4); }
.status--inbjuden   { background: rgba(201,168,76,0.2); color: var(--color-accent); border: 1px solid rgba(201,168,76,0.3); }
.status--incheckad  { background: rgba(45,100,200,0.2); color: #7ab0ff; border: 1px solid rgba(45,100,200,0.4); }
.status--ej-inbjuden { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.status--publicerad { background: rgba(45,138,78,0.2); color: #4ec97a; border: 1px solid rgba(45,138,78,0.4); }
.status--utkast     { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.status--vantar     { background: rgba(201,168,76,0.15); color: var(--color-accent); border: 1px solid rgba(201,168,76,0.3); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card--accent { border-color: rgba(201,168,76,0.3); }
.card--compact { padding: 16px; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card__head h2 { font-size: 16px; font-weight: 600; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table--full { width: 100%; }
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table__primary { font-weight: 600; }
.table__mono { font-family: monospace; font-size: 13px; color: var(--color-text-muted); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }
.table--empty { text-align: center; color: var(--color-text-muted); padding: 32px !important; }

/* ─── Flash messages ─────────────────────────────────────────────────────────── */

.flash {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
.flash--success { background: rgba(45,138,78,0.15); color: #4ec97a; border: 1px solid rgba(45,138,78,0.3); }
.flash--error   { background: rgba(192,57,43,0.15); color: #e87070; border: 1px solid rgba(192,57,43,0.3); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-top: 8px; }
.alert--success { background: rgba(45,138,78,0.12); color: #4ec97a; border: 1px solid rgba(45,138,78,0.25); }
.alert--info    { background: rgba(26,95,158,0.12); color: #6ab0f5; border: 1px solid rgba(26,95,158,0.3); }
.alert--warning { background: rgba(212,160,23,0.12); color: #f0c040; border: 1px solid rgba(212,160,23,0.3); }

/* ─── Stats ──────────────────────────────────────────────────────────────────── */

.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  flex: 1;
  min-width: 100px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card--ja { border-color: rgba(45,138,78,0.3); }
.stat-card--nej { border-color: rgba(138,45,45,0.3); }
.stat-card--in { border-color: rgba(201,168,76,0.3); }
.stat-card__value { display: block; font-size: 28px; font-weight: 700; font-family: var(--font-heading); color: var(--color-accent); }
.stat-card__label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); margin-top: 4px; }

/* ─── Login-sida ─────────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 60%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.login-card__logo { text-align: center; margin-bottom: 32px; }
.login-card__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; text-align: center; }
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ─── Brand ──────────────────────────────────────────────────────────────────── */

.brand { font-family: var(--font-heading); font-size: 28px; letter-spacing: 0.02em; color: var(--color-text); }
.brand strong { color: var(--color-accent); font-weight: 700; }

/* ─── Hemsida ────────────────────────────────────────────────────────────────── */

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, #17140E 0%, transparent 70%),
    linear-gradient(to bottom, #0d0b07 0%, #000000 60%);
}

.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 56px;
}

.home-nav__logo { text-decoration: none; }

.home-nav__login {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 24px;
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.home-nav__login:hover {
  color: #C9A84C;
  border-color: rgba(201,168,76,0.4);
}

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 120px;
  background: none;
}

.home-hero__eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #C9A84C;
  margin-bottom: 32px;
}

.home-hero__title {
  font-family: var(--yi-font);
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 100;
  line-height: 1.08;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 28px;
  color: #fff;
}

.home-hero__sub {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,0.4);
  max-width: 420px;
  margin-bottom: 52px;
  font-weight: 300;
}

.home-hero__cta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0a0a0a;
  background: #C9A84C;
  padding: 16px 48px;
  border-radius: 2px;
  transition: background 0.2s, transform 0.2s;
}
.home-hero__cta:hover {
  background: #d9b85c;
  transform: translateY(-1px);
}

.home-footer {
  text-align: center;
  padding: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
}

/* ─── Felpagina ──────────────────────────────────────────────────────────────── */

.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.error-page__code { font-family: var(--font-heading); font-size: 120px; font-weight: 300; color: var(--color-accent); line-height: 1; }
.error-page__title { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.error-page__message { color: var(--color-text-muted); margin-bottom: 32px; }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ─── Premium Animationer ────────────────────────────────────────────────────── */

@keyframes yi-fade-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes yi-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes yi-scale-x {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes yi-glow-breathe {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.35); }
}
@keyframes yi-text-glow {
  0%, 100% { text-shadow: 0 0 24px rgba(247,244,236,0.18); }
  50%       { text-shadow: 0 0 52px rgba(247,244,236,0.38), 0 0 90px rgba(201,168,76,0.18); }
}
@keyframes yi-gold-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes yi-card-glow {
  0%, 100% { box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 0px rgba(201,168,76,0); }
  50%       { box-shadow: 0 0 80px rgba(0,0,0,0.8), 0 0 60px rgba(201,168,76,0.06); }
}

/* Startsida — levande bakgrundsglow */
.home-page { position: relative; overflow: hidden; }
.home-page::before {
  content: '';
  position: fixed;
  top: -30vh;
  left: 50%;
  width: min(700px, 100vw);
  height: min(700px, 100vw);
  background: radial-gradient(circle, rgba(201,168,76,0.07) 0%, transparent 70%);
  pointer-events: none;
  animation: yi-glow-breathe 9s ease-in-out infinite;
  z-index: 0;
}
.home-nav, .home-hero, .home-footer { position: relative; z-index: 1; }

/* Startsida — entré-animationer */
.home-nav                 { animation: yi-fade-in 1s 0.1s ease both; }
.home-hero .yi-eyebrow    { animation: yi-fade-up 0.9s 0.45s ease both; }
.home-hero__title         { animation: yi-fade-up 1.1s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.home-hero .yi-divider    { transform-origin: center; animation: yi-scale-x 1.1s 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.home-hero__sub           { animation: yi-fade-up 0.9s 1.2s ease both; }
.home-hero .yi-btn        { animation: yi-fade-up 0.9s 1.45s ease both; }
.home-footer              { animation: yi-fade-in 1s 1.8s ease both; }

/* Startsida — logo glow-puls */
.home-nav__logo .yi-wordmark__your { animation: yi-text-glow 6s 2s ease-in-out infinite; }

/* Startsida — INVITE-shimmer */
.home-nav__logo .yi-wordmark__invite {
  background-size: 200% auto;
  animation: yi-gold-shimmer 5s 2.5s linear infinite;
}

/* Inloggningssida — entré */
.login-card {
  animation: yi-fade-up 1.1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both,
             yi-card-glow 6s 2s ease-in-out infinite;
  border-color: rgba(201,168,76,0.22);
}
.login-card__logo  { animation: yi-fade-up 1s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.login-card__title { animation: yi-fade-up 0.9s 0.75s ease both; }
.login-form        { animation: yi-fade-up 0.9s 0.95s ease both; }

/* Inloggningssida — logo glow-puls */
.login-card__logo .yi-wordmark__your { animation: yi-text-glow 6s 1.8s ease-in-out infinite; }
.login-card__logo .yi-wordmark__invite {
  background-size: 200% auto;
  animation: yi-gold-shimmer 5s 2.2s linear infinite;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 8px; }
  .stat-card { min-width: 80px; }
  .stat-card__value { font-size: 22px; }
}
