:root {
  color-scheme: light;
  --bg: #fff8f5;
  --surface: rgba(255, 255, 255, 0.42);
  --surface-strong: rgba(255, 255, 255, 0.64);
  --text: #4a3d47;
  --muted: #9a8996;
  --line: rgba(255, 255, 255, 0.48);
  --brand: #be6f91;
  --brand-strong: #a86d87;
  --rose: #f2b6c7;
  --peach: #f6d5b4;
  --mint: #bde4dd;
  --lavender: #c7c9ee;
  --danger: #b42318;
  --success: #087443;
  --shadow-soft: 0 24px 70px rgba(129, 91, 113, 0.18);
  --shadow-button: 0 16px 34px rgba(190, 111, 145, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 14% 10%, rgba(242, 182, 199, 0.72), transparent 30%),
    radial-gradient(circle at 88% 14%, rgba(199, 201, 238, 0.74), transparent 32%),
    radial-gradient(circle at 78% 84%, rgba(189, 228, 221, 0.72), transparent 36%),
    radial-gradient(circle at 24% 86%, rgba(246, 213, 180, 0.5), transparent 34%),
    linear-gradient(145deg, #fffaf7 0%, #fff1f7 42%, #f4fbf8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 28%, rgba(255, 255, 255, 0.22) 52%, transparent 72%),
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 76%);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.34);
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 10px 30px rgba(129, 91, 113, 0.08);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8a6578;
  font-weight: 650;
  text-decoration: none;
  line-height: 1;
}

.brand-mark,
.private-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(190, 111, 145, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 237, 244, 0.44));
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 650;
  box-shadow: 0 12px 28px rgba(129, 91, 113, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 20px;
}

.login-panel,
.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(30px) saturate(165%);
  -webkit-backdrop-filter: blur(30px) saturate(165%);
}

.login-panel {
  display: grid;
  gap: 6px;
  max-width: 430px;
  margin: 48px auto 0;
  padding: 26px;
}

.verify-panel {
  max-width: 520px;
}

.login-panel::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 32%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.18), transparent 42%);
}

.private-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel + .panel {
  margin-top: 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 640;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: 2rem;
  font-weight: 660;
}

h2 {
  font-size: 1.3rem;
  font-weight: 680;
}

.muted,
.hint,
.empty {
  color: var(--muted);
}

.muted {
  margin-top: 8px;
}

.empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
}

.hint {
  margin: -4px 0 2px;
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

label {
  color: #766372;
  font-size: 0.92rem;
  font-weight: 650;
}

input,
textarea,
button {
  width: 100%;
  font: inherit;
  border-radius: 8px;
}

input,
textarea {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.44);
  padding: 14px 15px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(129, 91, 113, 0.06);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

input[type="file"] {
  min-height: 52px;
  padding: 10px;
}

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 240, 245, 0.76);
  color: #a86d87;
  font-weight: 650;
  padding: 8px 12px;
}

input::placeholder,
textarea::placeholder {
  color: #ad9daa;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(246, 213, 180, 0.72);
  outline-offset: 2px;
}

input:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(190, 111, 145, 0.08), 0 12px 26px rgba(129, 91, 113, 0.09);
}

button {
  min-height: 54px;
  border: 0;
  background: linear-gradient(135deg, rgba(190, 111, 145, 0.94), rgba(233, 169, 184, 0.9));
  color: #fff;
  padding: 14px 18px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow-button), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(108%);
  box-shadow: 0 16px 30px rgba(190, 111, 145, 0.28);
}

button:disabled {
  cursor: wait;
  filter: grayscale(10%) opacity(0.74);
  transform: none;
}

button.secondary {
  background: linear-gradient(135deg, rgba(141, 149, 207, 0.9), rgba(166, 215, 207, 0.88));
  box-shadow: 0 12px 22px rgba(141, 149, 207, 0.16);
}

button.ghost {
  width: auto;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.38);
  color: #8a6578;
  border: 1px solid rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  padding: 8px 12px;
  box-shadow: none;
}

.section-title,
.submission-head {
  display: grid;
  gap: 12px;
}

.consent-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.consent-actions form {
  margin: 0;
}

.camera-box {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.camera-box video {
  width: 1px;
  height: 1px;
}

.validation-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 14px 32px rgba(129, 91, 113, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.validation-box p {
  margin: 0;
  color: #7f6878;
  font-weight: 650;
}

.validation-orb {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(from 0deg, rgba(190, 111, 145, 0.18), rgba(190, 111, 145, 0.9), rgba(189, 228, 221, 0.72), rgba(190, 111, 145, 0.18));
  animation: spin 1s linear infinite;
}

.validation-orb span {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.validation-box.complete .validation-orb {
  background: linear-gradient(135deg, rgba(121, 175, 166, 0.95), rgba(189, 228, 221, 0.95));
  animation: none;
}

.validation-box.complete .validation-orb span::before {
  content: "";
  display: block;
  width: 22px;
  height: 12px;
  margin: 19px auto 0;
  border-left: 3px solid #5b948c;
  border-bottom: 3px solid #5b948c;
  transform: rotate(-45deg);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 14px 32px rgba(129, 91, 113, 0.1);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.tabs a {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #7d6977;
  font-weight: 640;
  text-align: center;
  text-decoration: none;
}

.tabs a.active {
  background: rgba(255, 255, 255, 0.58);
  color: #8f5873;
  box-shadow: 0 10px 22px rgba(129, 91, 113, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.message,
.submission,
.event {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.message {
  background: linear-gradient(135deg, rgba(255, 238, 244, 0.58), rgba(255, 250, 244, 0.42));
  border-color: rgba(190, 111, 145, 0.22);
  box-shadow: 0 14px 32px rgba(190, 111, 145, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.submission {
  background: linear-gradient(135deg, rgba(233, 249, 246, 0.6), rgba(248, 249, 255, 0.46));
  border-color: rgba(121, 175, 166, 0.22);
  box-shadow: 0 14px 32px rgba(121, 175, 166, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.event {
  background: rgba(255, 255, 255, 0.28);
}

.message p,
.submission p {
  margin: 10px 0 0;
  font-size: 1.02rem;
  color: #5b4d58;
}

time,
.event span,
.event small {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.message time {
  color: var(--brand-strong);
  font-weight: 650;
}

.submission time {
  color: #6a9e96;
  font-weight: 650;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gallery a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 241, 245, 0.46);
  box-shadow: 0 10px 22px rgba(129, 91, 113, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-list {
  display: grid;
  gap: 14px;
}

.verification-photo {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 241, 245, 0.46);
  box-shadow: 0 10px 24px rgba(129, 91, 113, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.verification-photo img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.details dt {
  color: #6a9e96;
  font-weight: 680;
}

.details dd {
  margin: 0 0 8px;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(129, 91, 113, 0.08);
}

.flash.error {
  color: var(--danger);
  background: rgba(255, 240, 238, 0.92);
  border: 1px solid #ffd1cc;
}

.flash.success {
  color: var(--success);
  background: rgba(236, 253, 243, 0.92);
  border: 1px solid #b7efcf;
}

@media (min-width: 680px) {
  .topbar {
    padding: 14px 24px;
  }

  .shell {
    padding: 30px;
  }

  .login-panel {
    margin-top: 74px;
    padding: 30px;
  }

  .section-title,
  .submission-head {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .consent-actions {
    grid-template-columns: 1fr 160px;
    align-items: center;
  }

  .photo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title form {
    width: 230px;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .details {
    grid-template-columns: 170px 1fr;
  }

  .details dd {
    margin-bottom: 0;
  }
}
