/*
 * Inbjudan. Samma yta som inloggningen och installationssidan: persikobakgrund
 * som alltid är ljus, kort som följer ljust eller mörkt läge. Fyller hela
 * skärmen i den installerade appen.
 */

.iv {
  --i-box: #ffffff;
  --i-sub: #f3f1ec;
  --i-text: #161616;
  --i-2: #6f6c66;
  --i-3: #9a968f;
  --i-line: rgba(22, 22, 22, .085);
  --i-focus: rgba(228, 113, 135, .3);
  --i-coral: #e47187;
  --i-coral-soft: rgba(228, 113, 135, .13);
  --i-green: #1f6b3e;
  --i-green-soft: #e8f6ed;
  --i-red: #c0392b;
  --i-shadow: 0 14px 40px rgba(120, 50, 40, .14), 0 0 0 1px rgba(22, 22, 22, .04);
  --i-brand: linear-gradient(135deg, #f08c75 0%, #ec7f7d 48%, #e47187 100%);
  --i-ease: cubic-bezier(.2, .85, .25, 1);

  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--i-text);
  font-family: var(--font-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  background: linear-gradient(165deg, #fdeadf 0%, #f9cdb8 52%, #f3aa9c 100%) fixed;
  -webkit-tap-highlight-color: transparent;
}

:root[data-theme="dark"] .iv {
  --i-box: #111112;
  --i-sub: #1c1c1e;
  --i-text: #f2f2ef;
  --i-2: #a3a39e;
  --i-3: #75756f;
  --i-line: rgba(255, 255, 255, .09);
  --i-focus: rgba(240, 140, 117, .35);
  --i-coral-soft: rgba(240, 140, 117, .18);
  --i-green: #7fd1a0;
  --i-green-soft: #1b3025;
  --i-red: #ff8f82;
  --i-shadow: 0 14px 40px rgba(70, 14, 28, .3), 0 0 0 1px rgba(255, 255, 255, .08);
}

.iv *, .iv *::before, .iv *::after { box-sizing: border-box; }
.iv [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.iv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 6px;
}
.iv-round {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: #161616;
  cursor: pointer; text-decoration: none;
}
.iv-round svg {
  grid-area: 1 / 1; width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
}
.iv-theme svg { width: 22px; height: 22px; stroke-width: 1.8; transition: transform .55s var(--i-ease), opacity .3s; }
.iv-theme .moon { opacity: 0; transform: rotate(-80deg) scale(.4); }
:root[data-theme="dark"] .iv-theme .sun { opacity: 0; transform: rotate(80deg) scale(.4); }
:root[data-theme="dark"] .iv-theme .moon { opacity: 1; transform: none; }
.iv-round:focus-visible, .iv-go:focus-visible, .iv-ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--i-focus); }

.iv-wrap {
  width: 100%; max-width: 520px; margin: 0 auto;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 40px);
}
.iv-state { animation: iv-in .55s var(--i-ease) both; }
@keyframes iv-in { from { opacity: 0; transform: translateY(18px); } }

.iv h1 { margin: 0 0 8px; color: #161616; font-size: 32px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.iv-lead { margin: 0 0 22px; color: rgba(22, 22, 22, .66); font-size: 15.5px; line-height: 1.45; }
.iv-center { text-align: center; padding-top: 6vh; }
.iv-center .iv-go { display: flex; margin-top: 24px; }

.iv-card {
  display: grid; gap: 12px;
  padding: 18px; border-radius: 30px;
  background: var(--i-box); box-shadow: var(--i-shadow);
}
.iv-who { margin: 0; padding: 0 4px; color: var(--i-2); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.iv-field { position: relative; display: block; }
.iv-field > svg {
  position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  fill: none; stroke: var(--i-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.iv-field input {
  width: 100%; height: 56px; padding: 0 52px 0 50px;
  border: 0; border-radius: 999px; background: var(--i-sub); color: var(--i-text);
  font: inherit; font-size: 16px; outline: none; transition: box-shadow .2s;
}
.iv-field input::placeholder { color: var(--i-3); }
.iv-field input:focus { box-shadow: 0 0 0 3px var(--i-focus); }
.iv-eye { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--i-3); cursor: pointer; border-radius: 50%; }
.iv-eye svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.iv-eye .eye-open { display: none; }
.iv-eye[aria-pressed="true"] .eye-open { display: block; }
.iv-eye[aria-pressed="true"] .eye-closed { display: none; }
.iv-rule { margin: -2px 6px 0; color: var(--i-3); font-size: 13px; }

.iv-error { display: none; padding: 0 8px; color: var(--i-red); font-size: 14px; line-height: 1.4; }
.iv-error.show { display: block; }

.iv-go {
  display: flex; align-items: center; justify-content: center;
  height: 56px; width: 100%; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--i-brand); color: #fff;
  font: inherit; font-size: 16.5px; font-weight: 650; text-decoration: none; cursor: pointer;
  box-shadow: 0 12px 28px rgba(228, 113, 135, .32);
  transition: transform .2s var(--i-ease), opacity .2s;
}
.iv-go:active { transform: scale(.98); }
.iv-go:disabled { opacity: .55; pointer-events: none; }
.iv-danger { background: #d4493b; box-shadow: 0 12px 28px rgba(212, 73, 59, .3); }
.iv-ghost {
  height: 48px; border: 0; border-radius: 999px; background: transparent;
  color: var(--i-2); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* Resultat */
.iv-results { display: grid; gap: 14px; margin-top: 16px; }
.iv-results:empty { display: none; }
.iv-invite { padding: 18px; border-radius: 30px; background: var(--i-box); box-shadow: var(--i-shadow); animation: iv-in .55s var(--i-ease) both; animation-delay: calc(var(--n, 0) * 70ms); }
.iv-invite-head { display: flex; align-items: center; gap: 14px; }
.iv-badge { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--i-coral-soft); color: var(--i-coral); }
.iv-badge svg, .iv-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iv-invite b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.iv-invite small { display: block; margin-top: 2px; color: var(--i-2); font-size: 13.5px; }
.iv-invite-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 16px; }
.iv-invite-actions .iv-go { height: 50px; font-size: 15.5px; }
.iv-invite-actions .iv-no { height: 50px; border: 0; border-radius: 999px; background: var(--i-sub); color: var(--i-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.iv-invite-actions .iv-no:disabled { opacity: .55; pointer-events: none; }
.iv-invite .iv-error { margin-top: 10px; padding: 0 4px; }

.iv-none { padding: 26px 22px; border-radius: 30px; background: var(--i-box); box-shadow: var(--i-shadow); text-align: center; animation: iv-in .55s var(--i-ease) both; }
.iv-none .iv-badge { margin: 0 auto 14px; }
.iv-none b { display: block; font-size: 18px; font-weight: 650; }
.iv-none p { margin: 8px 0 0; color: var(--i-2); font-size: 14.5px; line-height: 1.45; }

.iv-info { display: flex; gap: 10px; align-items: flex-start; margin: 20px 4px 0; color: rgba(22, 22, 22, .66); font-size: 13.5px; line-height: 1.45; }
.iv-info svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.iv-icon { width: 76px; height: 76px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 26px; background: var(--i-box); color: var(--i-coral); box-shadow: var(--i-shadow); }
.iv-icon.ok { color: var(--i-green); }
.iv-icon svg { width: 36px; height: 36px; }

.iv-spinner { width: 34px; height: 34px; margin: 20vh auto 0; border-radius: 50%; border: 3px solid rgba(22, 22, 22, .15); border-top-color: var(--i-coral); animation: iv-spin .8s linear infinite; }
@keyframes iv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .iv-state, .iv-invite, .iv-none { animation: none; } }
