/* Shared tokens and primitives for the page and the admin panel. */
:root {
  --bg-a: #fff7f3;
  --bg-b: #fde6ec;
  --bg-c: #f1e6fb;
  --card: rgba(255, 255, 255, 0.78);
  --card-solid: #fffafb;
  --line: rgba(229, 122, 152, 0.18);
  --ink: #4b2f3d;
  --ink-soft: #8a6b79;
  --ink-faint: #b9a2ad;
  --pink: #f4a3b9;
  --pink-deep: #e2728f;
  --pink-pale: #ffe3ea;
  --peach: #ffcfba;
  --lilac: #d8c4f4;
  --lilac-deep: #a98bd6;
  --ok: #7cc6a4;
  --danger: #e06a7d;
  --shadow: 0 10px 30px rgba(214, 112, 140, 0.14), 0 2px 6px rgba(214, 112, 140, 0.08);
  --shadow-sm: 0 4px 14px rgba(214, 112, 140, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 55%, var(--bg-c) 100%) fixed;
  background-color: var(--bg-b);
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-t)) calc(16px + var(--safe-r)) calc(28px + var(--safe-b)) calc(16px + var(--safe-l));
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-top: 16px;
  animation: rise 0.6s var(--ease) both;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.25s var(--spring), box-shadow 0.25s var(--ease), opacity 0.2s;
  touch-action: manipulation;
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
}
.btn:disabled {
  cursor: default;
  opacity: 0.55;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink-deep), var(--pink) 60%, var(--peach));
  box-shadow: 0 8px 20px rgba(226, 114, 143, 0.35);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--pink-deep);
  box-shadow: var(--shadow-sm);
}
.btn.big {
  width: 100%;
  min-height: 56px;
  font-size: 17px;
}
.btn.round {
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 24px;
}

.field {
  display: block;
  margin-top: 14px;
  position: relative;
}
.field-label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 6px 4px;
}
.field-label em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-faint);
}
.field-label em::before {
  content: '· ';
}
.field-label em:empty::before {
  content: none;
}
input[type='text'],
input[type='password'],
input[type='time'],
input[type='number'],
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  padding: 13px 14px;
  font-size: 16px; /* >=16px prevents iOS zoom on focus */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.4;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(244, 163, 185, 0.25);
}
::placeholder {
  color: var(--ink-faint);
}
:focus-visible {
  outline: 3px solid rgba(169, 139, 214, 0.55);
  outline-offset: 2px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: none;
  animation: spin 0.8s linear infinite;
}
.is-loading .spinner {
  display: inline-block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
