/* Gemensam stil för medlemsportalen – samma formspråk som index.php och utbildning.php */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sun: #ffb454;
  --sun-deep: #ff7a3c;
  --ink: #0a0f1a;
  --paper: #f4f1ea;
  --card: #0f1626;
  --line: rgba(244,241,234,0.12);
  --muted: rgba(244,241,234,0.6);
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #facc15;
}
html { background: var(--ink); }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--paper); line-height: 1.6; min-height: 100vh;
  background: radial-gradient(ellipse 90% 520px at 15% 0%, #19315a, transparent) no-repeat, var(--ink);
}
h1, h2, h3 { font-weight: 200; letter-spacing: 0.04em; }
a { color: var(--sun); }

/* ---------- TOPPMENY ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 30px;
  padding: 18px 5vw; background: rgba(10,15,26,0.85); border-bottom: 1px solid rgba(255,180,84,0.1);
}
.logo { color: var(--paper); text-decoration: none; font-weight: 300; font-size: 1.05rem; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.logo span { color: var(--sun); font-weight: 500; }
.topbar ul { display: flex; flex-wrap: wrap; gap: 8px 26px; list-style: none; }
.topbar ul a {
  position: relative; color: rgba(244,241,234,0.8); text-decoration: none; white-space: nowrap;
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.25s;
}
.topbar ul a::after { content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 1px; background: var(--sun); transition: width 0.3s; }
.topbar ul a:hover, .topbar ul a.active { color: var(--sun); }
.topbar ul a:hover::after, .topbar ul a.active::after { width: 100%; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 52px 5vw 90px; }
.wrap.narrow { max-width: 680px; }
.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.05; }
.page-head p { margin-top: 12px; color: var(--muted); }
.kicker { font-size: 0.74rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--sun-deep); margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); padding: 32px; }
.card-title { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sun); font-weight: 500; margin-bottom: 18px; }
.section-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sun); font-weight: 500;
  padding-bottom: 10px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.section-label span { color: var(--muted); font-weight: 400; letter-spacing: 0.12em; }

/* ---------- KNAPPAR ---------- */
.btn {
  display: inline-block; padding: 15px 30px; font-family: inherit; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; text-align: center;
  cursor: pointer; border: 1px solid transparent; transition: all 0.3s ease;
}
.btn-primary { background: var(--sun); color: var(--ink); }
.btn-primary:hover { background: #ffc878; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,180,84,0.3); }
.btn-ghost { border-color: rgba(244,241,234,0.4); color: var(--paper); font-weight: 500; }
.btn-ghost:hover { border-color: #fff; background: rgba(244,241,234,0.08); }
.btn-block { display: block; width: 100%; }

/* ---------- FORMULÄR ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.field input {
  width: 100%; padding: 13px 14px; font-family: inherit; font-size: 1rem; color: var(--paper);
  background: rgba(10,15,26,0.7); border: 1px solid rgba(244,241,234,0.18); border-radius: 0; transition: border-color 0.2s;
}
.field input:focus { outline: none; border-color: var(--sun); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0 14px; margin-bottom: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.form-actions .btn { flex: 1 1 180px; }

.notice { padding: 12px 16px; margin-bottom: 22px; font-size: 0.92rem; border-left: 2px solid; }
.notice.error { color: var(--danger); background: rgba(248,113,113,0.08); }
.notice.success { color: var(--ok); background: rgba(74,222,128,0.08); }

/* ---------- INLOGGNING ---------- */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 5vw;
  background: radial-gradient(ellipse 70% 45% at 50% 105%, rgba(255,122,60,0.32), transparent 70%);
}
.auth-card { width: 100%; max-width: 390px; }
.auth-card > .logo { display: block; text-align: center; margin-bottom: 34px; }
.auth-card .card { border-top: 2px solid var(--sun); }
.auth-card h1 { font-size: 2rem; line-height: 1.1; margin-bottom: 26px; }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.back-link:hover { color: var(--sun); }

/* ---------- PORTAL ---------- */
.dash { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; }
@media (min-width: 950px) { .dash { grid-template-columns: 1.2fr 0.8fr; } }

.fuel-total { text-align: center; padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.fuel-total .kicker { margin-bottom: 8px; }
.big-num { font-size: clamp(2.6rem, 6vw, 3.8rem); font-weight: 200; color: var(--sun); line-height: 1; white-space: nowrap; }
.big-num small { font-size: 0.42em; margin-left: 6px; }
.updated { margin-top: 12px; font-size: 0.8rem; color: var(--muted); }

.wing-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 38px; }
.plane-img { flex: 1 1 auto; min-width: 0; width: 100%; max-width: 400px; display: block; margin: 0 auto; filter: invert(1) brightness(2); opacity: 0.6; }

.gauge { flex: 0 0 56px; text-align: center; }
.gauge-lbl { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.gauge-val { font-size: 1.15rem; font-weight: 300; margin: 2px 0 8px; white-space: nowrap; }
.track {
  position: relative; width: 16px; height: 120px; margin: 0 auto; overflow: hidden;
  background: rgba(244,241,234,0.05); border: 1px solid rgba(244,241,234,0.28);
}
/* Streck var fjärdedel, som på ett instrument */
.track::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), rgba(10,15,26,0.7) calc(25% - 1px) 25%);
}
.fill {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--sun);
  transform-origin: bottom; animation: fill-up 0.9s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes fill-up { from { transform: scaleY(0); } }

.cans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 30px; }
.can { text-align: center; }
.can .track { width: 100%; max-width: 44px; height: 78px; }
.can .gauge-val { font-size: 1rem; margin: 0 0 8px; }
.can .gauge-lbl { margin-top: 8px; }

/* Mätarfärg efter fyllnadsgrad – gäller både vingar och dunkar */
.lvl-ok .fill { background: var(--ok); }
.lvl-mid .fill { background: var(--warn); }
.lvl-low .fill { background: var(--danger); }
.lvl-low .gauge-val { color: var(--danger); }
.lvl-empty .gauge-val { color: var(--muted); }

.totals { list-style: none; border-top: 1px solid var(--line); }
.totals li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.totals li b { font-weight: 400; color: var(--paper); white-space: nowrap; }
.totals li.grand { color: var(--paper); }
.totals li.grand b { color: var(--sun); font-size: 1.3rem; font-weight: 300; }
.card .btn-block { margin-top: 26px; }

.sun-times { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sun-times > div { background: var(--card); padding: 18px 20px; }
.sun-times .t { font-size: 1.9rem; font-weight: 200; color: var(--sun); line-height: 1.1; }
.sun-times .l { margin-top: 6px; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.weather-container { display: flex; justify-content: center; }

/* ---------- ADMIN ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 14px; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--sun); border-bottom: 1px solid rgba(255,180,84,0.35); white-space: nowrap;
}
td { padding: 16px 14px; vertical-align: top; font-size: 0.92rem; border-bottom: 1px solid var(--line); }
tr:hover td { background: rgba(244,241,234,0.03); }
td.nowrap { white-space: nowrap; }
td.msg { min-width: 260px; color: rgba(244,241,234,0.8); }
td a { color: var(--paper); text-decoration: none; border-bottom: 1px solid rgba(255,180,84,0.4); }
td a:hover { color: var(--sun); }
td a.btn-del { color: var(--danger); border: 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
td a.btn-del:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 10px 0; }

@media (max-width: 600px) {
  .wrap { padding-top: 34px; }
  .card { padding: 24px 18px; }
  .topbar ul { gap: 6px 18px; }
  .cans { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .fill { animation: none; }
}
