:root {
  --bg: #fff9fb;
  --bg-soft: #f8e8ee;
  --rose: #c97891;
  --rose-dark: #9b4e69;
  --text: #4f3841;
  --muted: #8c737d;
  --border: rgba(169, 101, 124, 0.2);
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 30px 80px rgba(138, 76, 98, 0.18);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(247, 208, 221, 0.7), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(220, 208, 244, 0.45), transparent 32%),
    linear-gradient(135deg, #fffafc 0%, #f9edf2 50%, #fff8f5 100%);
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.invite-card {
  width: min(100%, 560px);
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  text-align: center;
  animation: card-in 0.9s ease both;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2 { font-family: 'Cormorant Garamond', serif; }
h1 {
  margin: 0;
  font-size: clamp(2.7rem, 10vw, 4.8rem);
  line-height: 0.95;
  color: var(--rose-dark);
}
.subtitle {
  max-width: 410px;
  margin: 18px auto 30px;
  color: var(--muted);
  line-height: 1.65;
}

form { display: grid; gap: 18px; text-align: left; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 0.86rem; font-weight: 700; }

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
input { min-height: 52px; padding: 0 15px; }
textarea { resize: vertical; min-height: 112px; padding: 15px; }
/* Красивые и одинаковые поля даты/времени, включая Safari на iPhone */
.native-input-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.native-input-wrap input[type="date"],
.native-input-wrap input[type="time"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 54px;
  min-height: 54px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-size: 16px;
  line-height: 54px;
  text-align: left;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.native-input-wrap input[type="date"]::-webkit-date-and-time-value,
.native-input-wrap input[type="time"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.native-input-wrap input[type="date"]::-webkit-calendar-picker-indicator,
.native-input-wrap input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.native-input-icon {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 21px;
  height: 21px;
  color: var(--rose-dark);
  transform: translateY(-50%);
  pointer-events: none;
  opacity: .72;
}

.native-input-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@supports (-webkit-touch-callout: none) {
  .native-input-wrap input[type="date"],
  .native-input-wrap input[type="time"] {
    line-height: normal;
    padding-top: 0;
    padding-bottom: 0;
  }

  .native-input-wrap input[type="date"]::-webkit-date-and-time-value,
  .native-input-wrap input[type="time"]::-webkit-date-and-time-value {
    display: flex;
    align-items: center;
    height: 54px;
    min-height: 54px;
  }
}

input:focus, textarea:focus {
  border-color: rgba(188, 102, 132, 0.65);
  box-shadow: 0 0 0 4px rgba(201, 120, 145, 0.12);
}
input.invalid, textarea.invalid {
  border-color: #c54f66;
  box-shadow: 0 0 0 4px rgba(197, 79, 102, 0.11);
}
.field-meta { display: flex; justify-content: space-between; gap: 12px; min-height: 18px; }
.field-error { color: #b5425c; }
#counter { margin-left: auto; color: var(--muted); }
.form-message { min-height: 22px; text-align: center; color: #b5425c; font-size: .92rem; }
.form-message.success { color: #62865f; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.primary-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  background: linear-gradient(135deg, #d98da6, #b96180);
  box-shadow: 0 16px 30px rgba(177, 89, 121, .25);
}
.primary-button:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 20px 38px rgba(177, 89, 121, .31); }
.primary-button:active { transform: translateY(0) scale(.99); }
.primary-button:disabled { cursor: wait; opacity: .7; }
.button-heart { font-size: 1.4rem; animation: heartbeat 1.8s infinite; }
.secondary-button { padding: 12px 20px; color: var(--rose-dark); background: rgba(201, 120, 145, .12); }

.instagram-link {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--rose-dark);
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, color .2s ease;
}
.instagram-link:hover { color: var(--rose); transform: translateY(-1px); }
.instagram-icon { font-size: 1.3rem; }

.success-state { padding: 6px 0 2px; text-align: center; animation: card-in .55s ease both; }
.success-icon { font-size: 3rem; color: var(--rose); animation: flower-float 2.2s ease-in-out infinite; }
.success-state h2 { margin: 8px 0; font-size: 2.5rem; color: var(--rose-dark); }
.success-state p { margin: 0 0 22px; color: var(--muted); }

.honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

.background-glow {
  position: fixed;
  z-index: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(20px);
  opacity: .45;
}
.background-glow--one { left: -140px; top: -100px; background: #f6c7d5; }
.background-glow--two { right: -160px; bottom: -120px; background: #d8c8f0; }

.particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  bottom: -30px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 14px rgba(214, 136, 165, .45);
  animation: float-up linear infinite;
}

.flower {
  position: fixed;
  z-index: 2;
  width: 240px;
  height: 240px;
  opacity: .7;
  pointer-events: none;
  animation: flower-float 7s ease-in-out infinite;
}
.flower--left { left: -60px; bottom: -40px; transform: rotate(-18deg); }
.flower--right { right: -70px; top: -45px; transform: rotate(155deg); animation-delay: -3s; }
.petal, .flower-core { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; }
.petal {
  width: 95px;
  height: 58px;
  border-radius: 80% 18% 80% 18%;
  background: linear-gradient(135deg, rgba(255,228,236,.95), rgba(220,133,161,.85));
  box-shadow: inset -10px -8px 22px rgba(164, 74, 107, .12);
}
.petal--1 { transform: rotate(0deg) translate(10px,-28px); }
.petal--2 { transform: rotate(72deg) translate(10px,-28px); }
.petal--3 { transform: rotate(144deg) translate(10px,-28px); }
.petal--4 { transform: rotate(216deg) translate(10px,-28px); }
.petal--5 { transform: rotate(288deg) translate(10px,-28px); }
.flower-core { width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: radial-gradient(circle, #f7d6a4 0 20%, #d88ca4 65%, #b86482 100%); }

@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes flower-float { 0%,100% { margin-top: 0; } 50% { margin-top: -12px; } }
@keyframes float-up { from { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .9; } to { transform: translateY(-115vh) rotate(360deg); opacity: 0; } }

@media (max-width: 620px) {
  .page-shell { padding: 16px 12px; }
  .invite-card { padding: 28px 18px; border-radius: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .flower { width: 150px; height: 150px; opacity: .42; transform: scale(.7); }
  .flower--left { left: -66px; bottom: -22px; }
  .flower--right { right: -70px; top: -28px; }
  .subtitle { margin-bottom: 24px; }
}

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

@keyframes flower-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
