/* Stiler for innmelding til Life Kids/Hallovenn og medlemsregisteret.
   Fargene og skriftene følger resten av lifemandal.no. */
:root {
  --sand: #f6f0e6;
  --sand-deep: #ece2d2;
  --cream: #fdfbf5;
  --sea: #21403e;
  --sea-2: #345b59;
  --sea-soft: #587878;
  --sun: #e0a04a;
  --sun-soft: #f0c47e;
  --ink: #1f2e2c;
  --muted: #5c6c6a;
  --terra: #ea7f52;
  --line: rgba(31, 46, 44, .12);
  --error: #b3261e;
  --ok: #2e6b3a;
  --vipps: #ff5b24;
  --vipps-dark: #e64a15;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Mulish', system-ui, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 500; line-height: 1.15; color: var(--sea); }
a { color: var(--sea-2); }
a:hover { color: var(--sun); }

.m-wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.m-wrap-wide { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Topp */
.m-top { background: var(--cream); box-shadow: 0 1px 0 var(--line); }
.m-top .m-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.m-brand { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--sea); text-decoration: none; }
.m-brand img { height: 26px; width: auto; }
.m-back { font-weight: 600; font-size: .92rem; text-decoration: none; }

/* Hero */
.m-hero {
  background: linear-gradient(165deg, #172e2c 0%, #21403e 56%, #37615e 100%);
  color: var(--cream);
  padding: 44px 0 64px;
}
.m-hallovenn .m-hero { background: linear-gradient(165deg, #3b2a4a 0%, #5a3d5c 50%, #c0663a 130%); }
.m-hallovenn .m-top { background: #fff8f0; }
.m-eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sun-soft); margin-bottom: 12px;
}
.m-hero h1 { color: var(--cream); font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0; }
.m-lead { color: rgba(253, 250, 243, .85); font-size: 1.05rem; margin: 12px 0 0; max-width: 54ch; }

.m-main { padding-bottom: 48px; }
.m-public .m-main { margin-top: -34px; }

/* Kort */
.m-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px -30px rgba(33, 64, 62, .45);
}
.m-card h2 { font-size: 1.35rem; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.m-step {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--sand-deep); color: var(--sea-2); font-family: 'Mulish', sans-serif; font-size: .9rem; font-weight: 800;
}

/* Felt */
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.m-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .m-grid { grid-template-columns: 1fr; } .m-card { padding: 20px 16px; } }
.m-field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--sea); }
.m-field input, .m-admin input:not([type=checkbox]):not([type=hidden]), .m-admin select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d6cdbd;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.m-field input:focus, .m-admin input:focus, .m-admin select:focus {
  outline: none; border-color: var(--sea-soft); box-shadow: 0 0 0 4px rgba(88, 120, 120, .18);
}
.m-has-error input { border-color: var(--error); }
.m-error { color: var(--error); font-size: .88rem; font-weight: 600; margin: 6px 0 0; }
.m-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Grupper */
.m-groups { display: grid; gap: 10px; }
.m-group {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--sand); border: 1.5px solid transparent; border-radius: 14px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.m-group:hover { border-color: var(--sea-soft); }
.m-group input, .m-consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-check {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--sea-soft); background: #fff;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.m-check::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
input:checked + .m-check { background: var(--sea); border-color: var(--sea); }
input:checked + .m-check::after { opacity: 1; }
input:focus-visible + .m-check { box-shadow: 0 0 0 4px rgba(88, 120, 120, .3); }
.m-group:has(input:checked) { background: #eef3ef; border-color: var(--sea-soft); }
.m-group-text { flex: 1; display: flex; flex-direction: column; }
.m-group-text strong { color: var(--sea); }
.m-group-text small { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.m-price { font-weight: 800; color: var(--sea); white-space: nowrap; }
.m-group-single { cursor: default; }
.m-group-single:hover { border-color: transparent; }

/* Oppsummering */
.m-consent { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.m-consent .m-check { margin-top: 1px; }
.m-consent.m-has-error .m-check { border-color: var(--error); }
.m-total {
  display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 16px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.m-total strong { font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--sea); }
.m-vipps {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 16px; border: 0; border-radius: 100px; background: var(--vipps); color: #fff;
  font: inherit; font-size: 1.12rem; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s;
}
.m-vipps span { font-weight: 900; letter-spacing: -.01em; }
.m-vipps:hover { background: var(--vipps-dark); transform: translateY(-1px); }
.m-vipps.m-busy { opacity: .7; cursor: progress; }
.m-fine { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }

.m-alert { background: #fbeae8; border: 1px solid #f0c3be; color: var(--error); padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }

.m-button {
  display: inline-block; padding: 12px 24px; border-radius: 100px; background: var(--sun); color: var(--sea);
  font-weight: 700; text-decoration: none; border: 0; font: inherit; font-weight: 700; cursor: pointer;
}
.m-button:hover { background: var(--sun-soft); color: var(--sea); }
.m-secondary { background: var(--sand-deep); }
.m-center { text-align: center; }
.m-stack { display: grid; gap: 10px; }
.m-badge { display: inline-block; background: #fff3cd; padding: 4px 12px; border-radius: 100px; font-weight: 700; font-size: .85rem; }

/* Kvittering */
.m-receipt { text-align: center; }
.m-ok {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e3efe5; color: var(--ok);
  display: grid; place-items: center; font-size: 2rem; font-weight: 800;
}
.m-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.m-list li { background: var(--sand); padding: 6px 14px; border-radius: 100px; font-weight: 700; color: var(--sea); }
.m-spinner {
  width: 40px; height: 40px; margin: 8px auto 12px; border-radius: 50%;
  border: 4px solid var(--sand-deep); border-top-color: var(--vipps); animation: m-spin 1s linear infinite;
}
@keyframes m-spin { to { transform: rotate(360deg); } }

.m-foot { color: var(--muted); font-size: .85rem; padding: 0 0 32px; text-align: center; }
.m-foot a { color: var(--muted); }

/* ---------- Administrasjon ---------- */
.m-admin { background: #f3efe8; }
.m-admin h1 { font-size: 1.8rem; margin: 0 0 16px; }
.m-admin .m-main { padding-top: 28px; }
.m-admin main > form:not(.filters), .m-admin .m-main > h1 + p { max-width: 720px; }
.m-adminbar { background: var(--sea); color: var(--cream); }
.m-adminbar .m-wrap-wide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 56px; }
.m-adminbrand { font-family: 'Fraunces', serif; font-size: 1.2rem; }
.m-adminbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1; }
.m-adminbar a { color: var(--cream); text-decoration: none; font-weight: 600; font-size: .95rem; }
.m-adminbar a:hover { color: var(--sun-soft); }
.m-adminbar form { margin: 0; font-size: .9rem; opacity: .9; }
.m-linkbtn { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.m-admin button, .m-admin .button {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 100px; background: var(--sea); color: var(--cream);
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
}
.m-admin button:hover, .m-admin .button:hover { background: var(--sea-2); color: var(--cream); }
.m-admin .secondary { background: var(--sand-deep); color: var(--sea); }
.m-admin .secondary:hover { background: #e2d6c2; color: var(--sea); }
.m-admin .danger { background: var(--error); }
.m-admin .m-adminbar button { background: none; padding: 0; font-weight: 400; }

.m-admin .muted { color: var(--muted); }
.m-admin .field { margin-bottom: 14px; }
.m-admin .field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--sea); }
.m-admin .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .m-admin .row { grid-template-columns: 1fr; } }
.m-admin fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; background: var(--cream); }
.m-admin legend { font-weight: 700; color: var(--sea); padding: 0 6px; }
.m-admin label.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-weight: 400; }
.m-admin label.check input { width: 18px; height: 18px; }
.m-admin label.check span { flex: 1; }
.m-admin .has-error input { border-color: var(--error); }
.m-admin .error { color: var(--error); font-size: .88rem; font-weight: 600; margin: 4px 0 0; }
.m-admin .alert { background: #fbeae8; border: 1px solid #f0c3be; color: var(--error); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.m-admin .notice { background: #e6f0e8; border: 1px solid #bfd8c4; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 700; color: var(--sea); gap: 4px; }
.filters input, .filters select { width: auto !important; min-width: 120px; padding: 9px 12px !important; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.stats div { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 18px; color: var(--muted); font-size: .92rem; }
.stats span { display: block; font-family: 'Fraunces', serif; font-size: 2.1rem; color: var(--sea); line-height: 1.1; }

.table-wrap { overflow-x: auto; background: var(--cream); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; }
.m-admin table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.m-admin th, .m-admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.m-admin thead th { background: var(--sand); color: var(--sea); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.m-admin tbody tr:hover { background: #faf6ee; }
.m-admin tfoot th { border-top: 2px solid var(--sea); border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; }
.center { text-align: center !important; }
table.compact th, table.compact td { padding: 5px 8px; font-size: .85rem; }

.exports, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions form { margin: 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.details dt { font-weight: 700; color: var(--sea); }
.details dd { margin: 0; }

.status { padding: 3px 10px; border-radius: 100px; font-size: .8rem; font-weight: 700; background: #eee; white-space: nowrap; }
.status-paid { background: #e3efe5; color: var(--ok); }
.status-pending { background: #fdf0d5; color: #8a5a00; }
.status-cancelled, .status-failed { background: #eeeae4; color: var(--muted); }
.status-refunded { background: #fbeae8; color: var(--error); }

@media print {
  .m-admin { background: #fff; }
  .m-adminbar, .no-print { display: none !important; }
  .table-wrap { border: 0; overflow: visible; }
  a { color: inherit; text-decoration: none; }
  tr { page-break-inside: avoid; }
}

.m-brand { white-space: nowrap; }
.m-receipt h2 { justify-content: center; }
@media (max-width: 560px) {
  .m-back-long { display: none; }
}
.m-back-short { display: none; }
@media (max-width: 560px) { .m-back-short { display: inline; } }

/* Innlogging */
.m-login { max-width: 400px; margin: 40px auto; background: var(--cream); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.m-login h1 { text-align: center; }
.m-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px;
  border: 1.5px solid #d6cdbd; border-radius: 100px; background: #fff; color: var(--ink);
  font-weight: 700; text-decoration: none;
}
.m-google:hover { border-color: var(--sea-soft); color: var(--ink); }
.m-pw { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.m-pw summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.m-admin .m-center { text-align: center; }

/* Flere barn */
.m-top0 { margin-top: -8px; margin-bottom: 14px; }
.m-child {
  position: relative; border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 16px 16px;
  margin: 0 0 14px; background: #fff;
}
.m-child legend { padding: 0 8px; font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--sea); }
.m-child .m-groups { margin-top: 14px; }
.m-groups-label { margin: 0; font-weight: 700; font-size: .9rem; color: var(--sea); }
.m-remove {
  position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--error);
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; padding: 4px 6px;
}
.m-remove:hover { text-decoration: underline; }
.m-add {
  width: 100%; padding: 13px; border: 2px dashed var(--sea-soft); border-radius: 14px; background: transparent;
  color: var(--sea); font: inherit; font-weight: 700; cursor: pointer; transition: background .2s;
}
.m-add:hover { background: #eef3ef; }
.m-total small { display: block; color: var(--muted); font-size: .85rem; }
.m-receipt-child { margin-bottom: 6px; }
.m-receipt-child strong { display: block; color: var(--sea); margin-bottom: 4px; }

/* Adresse per barn */
.m-child-addr { margin-top: 12px; padding: 10px 12px; background: var(--sand); border-radius: 12px; }
.m-addr-line { margin: 0 0 6px; font-size: .92rem; color: var(--muted); }
.m-addr-line span { color: var(--ink); font-weight: 600; }
.m-own { position: relative; display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: .92rem; }
.m-own input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-own .m-check { width: 20px; height: 20px; border-radius: 6px; }
.m-addr-own { display: none; margin-top: 12px; }
.m-child-addr:has(input[data-own]:checked) .m-addr-own { display: grid; }
.m-child-addr:has(input[data-own]:checked) .m-addr-line { display: none; }

/* Bytte mellom innmelding for foresatte og «meld deg inn selv» */
.m-switch {
  margin: 0 0 14px; padding: 12px 16px; background: var(--cream); border: 1px solid var(--line);
  border-radius: 14px; font-size: .95rem; box-shadow: 0 18px 40px -30px rgba(33, 64, 62, .45);
}
.m-switch a { font-weight: 700; }
