@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --pink: #ff6b9d;
  --pink-dark: #e8437a;
  --pink-light: #ffb3cc;
  --sky: #87ceeb;
  --sky-light: #b8e4f9;
  --grass: #7ec850;
  --grass-dark: #5a9e32;
  --yellow: #ffd93d;
  --white: #ffffff;
  --text: #2d3436;
  --muted: #636e72;
  --shadow: 0 8px 24px rgba(45, 52, 54, 0.12);
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--sky-light) 0%, var(--sky) 42%, var(--grass) 100%);
  -webkit-text-size-adjust: 100%;
  height: -webkit-fill-available;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(180deg, var(--sky-light) 0%, var(--sky) 42%, var(--grass) 100%);
  color: var(--text);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.page {
  padding: 24px 16px 48px;
}

.wrap { max-width: 520px; margin: 0 auto; width: 100%; }

.box,
.hero-card,
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 3px solid var(--pink-light);
}

.box {
  padding: 32px 28px 36px;
}

.hero-card {
  padding: 28px 24px 32px;
  text-align: center;
}

.card {
  padding: 22px;
  margin-bottom: 20px;
}

h1 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--pink-dark);
}

h1.page-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.sub, .lead {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

.sub { margin-bottom: 22px; font-size: 0.92rem; }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--pink-dark);
}

.pw-wrap { position: relative; }

.pw-wrap input { padding-right: 52px; }

.toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--sky-light);
  border: 2px solid var(--sky);
  border-radius: 10px;
  width: 40px;
  height: 36px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-dark);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  background: #f8fcff;
  border: 2px solid #dfe6e9;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--pink);
  background: var(--white);
}

input::placeholder { color: #b2bec3; }

.pw-wrap input:-webkit-autofill,
.pw-wrap input:-webkit-autofill:hover,
.pw-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px #f8fcff inset !important;
}

.btn {
  width: 100%;
  background: linear-gradient(180deg, var(--pink), var(--pink-dark));
  color: var(--white);
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 4px 14px rgba(232, 67, 122, 0.35);
}

.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: linear-gradient(180deg, var(--sky-light), var(--sky));
  color: var(--text);
  box-shadow: 0 4px 12px rgba(135, 206, 235, 0.45);
  border: 2px solid #fff;
}

.btn-logout {
  background: #2d3436;
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 52, 54, 0.25);
}

.btn-logout:hover { background: #3d4649; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.actions .btn {
  width: auto;
  min-width: 150px;
}

.features {
  list-style: none;
  text-align: left;
  margin: 0 auto 20px;
  max-width: 320px;
  line-height: 2;
  color: var(--text);
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--sky-light);
}

.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: var(--pink-dark);
  border-bottom-color: var(--pink);
}

.panel { display: none; }
.panel.active { display: block; }

.panel p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pay-btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--yellow), #ffb347);
  color: var(--text) !important;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(255, 179, 71, 0.4);
}

.pay-btn:hover { filter: brightness(1.04); }

.done-btn {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, var(--grass), var(--grass-dark));
  color: var(--white);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(94, 158, 50, 0.35);
}

.done-btn:hover { filter: brightness(1.05); }
.done-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.err {
  display: none;
  background: #fff5f5;
  border: 2px solid #ffb8b8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #d63031;
  font-size: 0.9rem;
  font-weight: 600;
}

.err.on { display: block; }

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.45;
}

.back { text-align: center; margin-top: 18px; }
.back a {
  color: var(--pink-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.toggle-row {
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.toggle-row a {
  color: var(--pink-dark);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.toggle-row a:hover { text-decoration: underline; }

.pig-badge,
.pig {
  text-align: center;
  font-size: 56px;
  line-height: 1;
  margin-bottom: 8px;
}

.pig { font-size: 72px; }

.bounce {
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.user-greeting {
  text-align: center;
  font-weight: 700;
  color: var(--pink-dark);
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff9e6, var(--yellow));
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(255, 217, 61, 0.35);
}

/* ── Телефон ── */
@media (max-width: 480px) {
  body.page,
  body.centered {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .box { padding: 24px 18px 28px; }
  .hero-card { padding: 22px 16px 26px; }
  .card { padding: 18px 14px; }

  h1 { font-size: 1.45rem; }
  h1.page-title { font-size: 1.35rem; }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
    min-width: 0;
  }

  .tab { font-size: 0.78rem; padding: 10px 4px; }
  .pay-btn { display: block; text-align: center; }
}

/* ── Планшет и шире ── */
@media (min-width: 600px) {
  .wrap { max-width: 560px; }

  .features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    max-width: 420px;
  }

  .hero-card {
    padding: 36px 32px 40px;
  }

  .pig { font-size: 88px; }
}

@media (min-width: 900px) {
  body.page { padding-top: 40px; }

  .wrap { max-width: 640px; }

  .hero-card,
  .box,
  .card {
    border-width: 4px;
  }
}
