/* ══════════════════════════════════════════════════════════════
   Saltsjöbadens FVF – Medlemsansökan
   Modern UI inspirerad av Untitled UI
   ══════════════════════════════════════════════════════════════ */

:root {
  --gray-25:    #fcfcfd;
  --gray-50:    #f9fafb;
  --gray-100:   #f2f4f7;
  --gray-200:   #eaecf0;
  --gray-300:   #d0d5dd;
  --gray-400:   #98a2b3;
  --gray-500:   #667085;
  --gray-600:   #475467;
  --gray-700:   #344054;
  --gray-800:   #1d2939;
  --gray-900:   #101828;

  --primary-50:  #eef1f6;
  --primary-100: #d4dae7;
  --primary-200: #a9b5cf;
  --primary-500: #2E497B;
  --primary-600: #263d68;
  --primary-700: #1e3155;
  --primary-800: #162542;

  --error-50:   #fef3f2;
  --error-300:  #fda29b;
  --error-500:  #f04438;
  --error-700:  #b42318;

  --warning-50:  #fffaeb;
  --warning-300: #fec84b;
  --warning-700: #b54708;

  --success-50:  #ecfdf3;
  --success-500: #12b76a;
  --success-700: #027a48;

  --swish-pink:  #e5175f;

  --font:       'DM Sans', system-ui, -apple-system, sans-serif;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --shadow-xs:  0 1px 2px rgba(16,24,40,.05);
  --shadow-sm:  0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06);
  --shadow-md:  0 4px 8px -2px rgba(16,24,40,.1), 0 2px 4px -2px rgba(16,24,40,.06);
  --shadow-lg:  0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03);
}

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

body {
  font-family: 'Fira Sans', var(--font);
  font-weight: 400;
  font-size: 1em;
  line-height: 1.8;
  background: #fff;
  color: #666;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ───────────────────────────────────────────────── */
.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

@media (min-width: 480px) {
  .wrap { padding: 2rem 1.5rem 4rem; }
}

@media (min-width: 640px) {
  .wrap { padding: 2rem 2rem 4rem; }
}

/* ── STEPS ────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
}

.step {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-400);
  transition: all .3s;
}

.step-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-400);
  transition: color .25s;
}

.step-connector {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
  flex-shrink: 0;
  margin: 0 .25rem;
  align-self: center;
  margin-top: -1px;
  border-radius: 1px;
  overflow: hidden;
}

.step-connector-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-500);
  border-radius: 1px;
  transition: width .4s ease;
}

.step-connector-fill.done {
  width: 100%;
}

/* Active step */
.step.active .step-dot {
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-50);
}
.step.active .step-label {
  color: var(--gray-900);
}

/* Done step */
.step.done {
  cursor: pointer;
}

.step.done .step-dot {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}
.step.done .step-dot span {
  display: none;
}
.step.done .step-dot::after {
  content: '\2713';
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary-600);
}
.step.done .step-label {
  color: var(--primary-700);
}

/* ── INFO BOX ─────────────────────────────────────────────── */
.info-box {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.info-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .625rem;
}

.info-box-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--primary-800);
}

.info-box-fee {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary-700);
  background: var(--primary-100);
  padding: .2rem .7rem;
  border-radius: var(--radius-sm);
}

.info-box p {
  font-size: 1em;
  line-height: 1.8;
  color: var(--primary-700);
  margin: 0;
}

.info-box a {
  color: var(--primary-800);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--primary-500);
}
.info-box a:hover {
  color: var(--primary-600);
}

.info-box p + p {
  margin-top: .35rem;
  font-size: .9em;
  color: var(--primary-600);
}

@media (max-width: 480px) {
  .step-connector { width: 24px; }
}

/* ── CARD ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
  animation: fadeUp .4s ease both;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 1em;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

/* ── FIELDS ───────────────────────────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: .375rem;
}
.field label .req { color: var(--error-500); margin-left: 1px; }

.field input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: .625rem .875rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray-900);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.field input::placeholder { color: var(--gray-400); }

.field input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(46, 73, 123, .16);
}

.field input.err {
  border-color: var(--error-300);
  background: var(--error-50);
}
.field input.err:focus {
  box-shadow: 0 0 0 4px rgba(240, 68, 56, .12);
}

.field .errmsg {
  font-size: .8rem;
  color: var(--error-700);
  margin-top: .35rem;
  display: none;
}
.field.has-err .errmsg { display: block; }

/* ── FISH TAGS ────────────────────────────────────────────── */
.fish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

.fish-tag {
  cursor: pointer;
}

.fish-tag input[type=checkbox] {
  display: none;
}

.fish-tag-label {
  display: inline-block;
  padding: .5rem 1.1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 100px;
  font-size: 1em;
  font-weight: 500;
  color: var(--gray-600);
  background: #fff;
  transition: all .15s;
  user-select: none;
}

.fish-tag-label:hover {
  border-color: var(--primary-500);
  color: var(--primary-700);
  background: var(--primary-50);
}

.fish-tag input:disabled + .fish-tag-label {
  opacity: .4;
  cursor: not-allowed;
  border-color: var(--gray-200);
}

.fish-tag input:checked + .fish-tag-label {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
  box-shadow: 0 0 0 1px var(--primary-500);
}

/* ── SWISH ────────────────────────────────────────────────── */
.swish-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .85rem 1.25rem;
  background: var(--swish-pink);
  color: #fff;
  font-family: 'Fira Sans', var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
}
.swish-app-btn:hover { background: #c91254; }

.swish-details {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
@media (max-width: 480px) {
  .swish-details { grid-template-columns: 1fr; }
}

.swish-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.swish-qr {
  width: 120px;
  height: 120px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.swish-qr img, .swish-qr canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.swish-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .4rem;
}

.srow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.srow .sk {
  font-size: .85rem;
  color: var(--gray-500);
}
.srow .sv {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-900);
  text-align: right;
}
.srow .sv.ref {
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--primary-600);
}

/* ── CONFIRM ──────────────────────────────────────────────── */
.confirm-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
}
.check-item input[type=checkbox] {
  width: 18px;
  height: 18px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--primary-500);
  cursor: pointer;
}
.check-item .clabel {
  font-size: 1em;
  line-height: 1.8;
  color: var(--gray-600);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.submit-btn {
  width: 100%;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .75rem 1.25rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  box-shadow: var(--shadow-xs);
}
.submit-btn:hover:not(:disabled) {
  background: var(--primary-600);
}
.submit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(46, 73, 123, .2);
}
.submit-btn:active { transform: scale(.995); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.submit-btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.back-btn {
  width: 100%;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: .7rem 1.25rem;
  margin-top: .75rem;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow-xs);
}
.back-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* ── ERR BANNER ───────────────────────────────────────────── */
.err-banner {
  background: var(--error-50);
  border: 1px solid var(--error-300);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  color: var(--error-700);
  display: none;
}
.err-banner.show { display: block; }

/* ── SUCCESS ──────────────────────────────────────────────── */
.success {
  display: none;
  text-align: center;
  padding: 4rem 1rem;
  animation: fadeUp .5s ease both;
}
.success.show { display: block; }

.success-ring {
  width: 72px;
  height: 72px;
  background: var(--success-50);
  border: 2px solid var(--success-500);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-ring svg {
  width: 32px;
  height: 32px;
  stroke: var(--success-500);
}

.success h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: .75rem;
}
.success p {
  color: var(--gray-600);
  font-size: 1em;
  line-height: 1.8;
  max-width: 460px;
  margin: 0 auto .75rem;
}

.success-ref {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .85rem;
  color: var(--gray-600);
}
.success-ref strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: .35rem;
  letter-spacing: .12em;
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
  font-size: .8rem;
  color: var(--gray-400);
}
footer a {
  color: var(--gray-500);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
