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

:root {
  --blue-dark: #1a5276;
  --blue: #2e86ab;
  --blue-light: #b8dff5;
  --blue-sky: #d4ecfa;
  --mint: #58d68d;
  --mint-dark: #27ae60;
  --yellow: #f9e79f;
  --white: #ffffff;
  --text: #1a5276;
  --muted: #5d6d7e;
  --shadow: 0 8px 24px rgba(26, 82, 118, 0.12);
  --radius: 20px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(160deg, var(--blue-light) 0%, var(--blue-sky) 45%, #c5e4f7 100%);
  min-height: 100vh;
  color: var(--text);
}

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(--blue-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(--blue-dark);
}

h1.page-title { font-size: 1.5rem; margin-bottom: 12px; line-height: 1.3; }

.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(--blue);
}

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

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

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

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

.btn {
  width: 100%;
  background: linear-gradient(180deg, var(--blue), var(--blue-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(26, 82, 118, 0.3);
}

.btn-secondary {
  background: linear-gradient(180deg, var(--blue-sky), var(--blue-light));
  color: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(184, 223, 245, 0.6);
  border: 2px solid #fff;
}

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

.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: 340px;
  line-height: 2;
  font-weight: 600;
}

.tabs {
  display: flex;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--blue-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(--blue-dark); border-bottom-color: var(--blue); }

.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), #f5b041);
  color: var(--blue-dark) !important;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
}

.done-btn {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, var(--mint), var(--mint-dark));
  color: var(--white);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.err {
  display: none;
  background: #fff5f5;
  border: 2px solid #ffb8b8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #d63031;
  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(--blue); text-decoration: none; font-weight: 700; }
.toggle-row { text-align: center; margin-top: 20px; color: var(--muted); }
.toggle-row a { color: var(--blue-dark); font-weight: 800; text-decoration: none; cursor: pointer; }

.cat-badge, .cat-hero { text-align: center; font-size: 56px; line-height: 1; margin-bottom: 8px; }
.cat-hero { font-size: 72px; }
.bounce { animation: bounce 2s ease infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, var(--blue-sky));
  font-size: 0.82rem;
  font-weight: 800;
  border: 2px solid #fff;
}

.user-greeting {
  text-align: center;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 14px;
}

@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));
  }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; min-width: 0; }
  .tab { font-size: 0.78rem; }
  .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: 440px; }
}
