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

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

button, a, input, select, textarea {
  touch-action: manipulation;
}

:root {
  --pink:      #ff6eb4;
  --hot-pink:  #ff2d78;
  --baby-pink: #ffb3d9;
  --lavender:  #c9a0ff;
  --mint:      #7fffd4;
  --sky:       #87ceeb;
  --yellow:    #fff176;
  --peach:     #ffb347;
  --cream:     #fff9fb;
}

/* ==================== ANIMATED RAINBOW BACKGROUND ==================== */
html {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #5a2d6e;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    #ffb3de 0%,
    #ffd6f5 15%,
    #d4b8ff 30%,
    #b3ecff 45%,
    #ffe4b3 60%,
    #d4f5d4 75%,
    #ffb3de 100%
  );
  background-size: 400% 400%;
  animation: bg-dance 12s ease infinite;
}

@keyframes bg-dance {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==================== FLOATING EMOJI LAYER ==================== */
.floaties {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floatie {
  position: absolute;
  bottom: -10%;
  line-height: 1;
  animation: rise linear infinite;
  opacity: 0;
}

@keyframes rise {
  0%   { transform: translateY(0)      rotate(0deg)   scale(0.8); opacity: 0; }
  5%   { opacity: 0.65; }
  95%  { opacity: 0.65; }
  100% { transform: translateY(-110vh) rotate(360deg) scale(1.1); opacity: 0; }
}

.f1  { left: 4%;  font-size: 2rem;   animation-duration: 14s; animation-delay: 0s; }
.f2  { left: 11%; font-size: 2.4rem; animation-duration: 10s; animation-delay: 2s; }
.f3  { left: 19%; font-size: 1.8rem; animation-duration: 16s; animation-delay: 0.5s; }
.f4  { left: 27%; font-size: 2.2rem; animation-duration: 12s; animation-delay: 4s; }
.f5  { left: 34%; font-size: 2rem;   animation-duration: 9s;  animation-delay: 1s; }
.f6  { left: 42%; font-size: 2.5rem; animation-duration: 13s; animation-delay: 3s; }
.f7  { left: 50%; font-size: 1.9rem; animation-duration: 11s; animation-delay: 1.5s; }
.f8  { left: 58%; font-size: 2.3rem; animation-duration: 15s; animation-delay: 5s; }
.f9  { left: 66%; font-size: 2rem;   animation-duration: 10s; animation-delay: 0.8s; }
.f10 { left: 74%; font-size: 2.1rem; animation-duration: 14s; animation-delay: 2.5s; }
.f11 { left: 82%; font-size: 2.4rem; animation-duration: 8s;  animation-delay: 3.5s; }
.f12 { left: 89%; font-size: 1.8rem; animation-duration: 12s; animation-delay: 1.8s; }
.f13 { left: 22%; font-size: 2rem;   animation-duration: 17s; animation-delay: 6s; }
.f14 { left: 62%; font-size: 2.2rem; animation-duration: 11s; animation-delay: 7s; }
.f15 { left: 94%; font-size: 2rem;   animation-duration: 9s;  animation-delay: 4.5s; }

/* ==================== LAYOUT ==================== */
.outer-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 5rem;
}

.container {
  width: 100%;
  max-width: 760px;
  background: rgba(255, 250, 253, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 30px;
  padding: 2.5rem 2rem;
  box-shadow:
    0 0 0 4px #ffb3d9,
    0 0 0 8px #d4b8ff,
    0 16px 56px rgba(201, 160, 255, 0.4);
}

/* ==================== HEADER ==================== */
.site-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.header-cats {
  font-size: 2.4rem;
  letter-spacing: 0.4rem;
  margin-bottom: 0.5rem;
  display: block;
  animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50%       { transform: rotate(4deg); }
}

h1 {
  font-family: 'Pacifico', cursive;
  font-size: 2.3rem;
  line-height: 1.2;
  background: linear-gradient(90deg, #ff2d78, #c9a0ff, #7fffd4, #ff9a00, #ff2d78);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

.subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a0ff;
  margin-bottom: 1rem;
}

.rainbow-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    #ff2d78, #ff9a00, #fff176, #7fffd4, #87ceeb, #c9a0ff, #ff6eb4
  );
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 3px 14px rgba(255, 110, 180, 0.5);
}

/* ==================== SECTION CARDS ==================== */
.card {
  background:
    radial-gradient(circle at 18px 18px,  rgba(255, 110, 180, 0.13) 5px, transparent 5px),
    radial-gradient(circle at 62px 58px,  rgba(201, 160, 255, 0.11) 4px, transparent 4px),
    radial-gradient(circle at 110px 30px, rgba(127, 255, 212, 0.10) 3px, transparent 3px),
    linear-gradient(135deg, rgba(255, 179, 217, 0.28), rgba(201, 160, 255, 0.22));
  background-size: 80px 80px, 80px 80px, 80px 80px, 100% 100%;
  border: 3px solid #ffb3d9;
  border-radius: 24px;
  padding: 1.8rem;
  margin-bottom: 1.6rem;
  position: relative;
}

.card:nth-child(even) {
  border-color: #c9a0ff;
}

.card::after {
  content: '🍄';
  position: absolute;
  top: -0.9rem;
  right: 1.4rem;
  font-size: 1.7rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.section-title {
  font-family: 'Pacifico', cursive;
  font-size: 1.25rem;
  color: #ff2d78;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==================== FORM ELEMENTS ==================== */
label {
  display: block;
  margin-top: 1rem;
  font-weight: 700;
  color: #7b2d8b;
  font-size: 0.95rem;
}

input[type=text],
select {
  width: 100%;
  padding: 0.65rem 1rem;
  margin-top: 0.3rem;
  border: 2.5px solid #ffb3d9;
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: #7b2d8b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type=text]:focus,
select:focus {
  border-color: #ff6eb4;
  box-shadow: 0 0 0 4px rgba(255, 110, 180, 0.22);
}

/* Custom heart checkboxes */
input[type=checkbox] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 2.5px solid #c9a0ff;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.4rem;
  cursor: pointer;
  background: white;
  flex-shrink: 0;
  transition: all 0.15s ease;
  font-size: 0.65rem;
  color: white;
}

input[type=checkbox]:checked {
  background: linear-gradient(135deg, #ff6eb4, #ff2d78);
  border-color: #ff2d78;
}

input[type=checkbox]:checked::after {
  content: '♥';
}

/* Complaints fieldset */
.complaints {
  border: 2.5px dashed #c9a0ff;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  margin-top: 1rem;
  background: rgba(201, 160, 255, 0.09);
}

.complaints legend {
  font-weight: 800;
  color: #7b2d8b;
  padding: 0 0.5rem;
  font-size: 0.95rem;
}

.complaints label {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  margin-right: 1rem;
  font-weight: 700;
  color: #7b2d8b;
}

/* ==================== ELEMENT ACCORDION ==================== */
.element-group {
  margin-top: 0.9rem;
  border: 2.5px solid #ffb3d9;
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s;
}

.element-group[open] {
  border-color: #c9a0ff;
}

.element-group summary {
  background: linear-gradient(90deg,
    rgba(255, 179, 217, 0.45),
    rgba(201, 160, 255, 0.35)
  );
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
  color: #7b2d8b;
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}

.element-group summary::-webkit-details-marker { display: none; }

.element-group[open] summary {
  background: linear-gradient(90deg,
    rgba(201, 160, 255, 0.5),
    rgba(127, 255, 212, 0.3)
  );
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.5rem 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 250, 253, 0.85);
}

.checkbox-grid label {
  margin: 0;
  font-weight: 600;
  color: #6a3d8b;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.checkbox-grid label:hover { color: #ff2d78; }

/* ==================== SUBMIT BUTTON ==================== */
.primary-btn:disabled {
  background: linear-gradient(135deg, #c9a0ff, #ffb3d9);
  cursor: not-allowed;
  transform: none !important;
  opacity: 0.85;
}

.primary-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  padding: 1rem 1.5rem;
  margin: 2rem auto 0;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #ff2d78 0%, #ff6eb4 50%, #c9a0ff 100%);
  background-size: 200% auto;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow:
    0 6px 24px rgba(255, 45, 120, 0.45),
    0 0 0 4px rgba(255, 179, 217, 0.5);
  transition: all 0.25s ease;
  animation: btn-pulse 3s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(255, 45, 120, 0.45), 0 0 0 4px rgba(255, 179, 217, 0.5);
  }
  50% {
    box-shadow: 0 8px 36px rgba(255, 45, 120, 0.65), 0 0 0 7px rgba(255, 179, 217, 0.7);
  }
}

.primary-btn:hover {
  background-position: right center;
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 12px 36px rgba(255, 45, 120, 0.55),
    0 0 0 6px rgba(255, 179, 217, 0.6);
  animation: none;
}

.primary-btn:active {
  transform: translateY(-1px);
}

/* ==================== RESULT CARD ==================== */
.result-card {
  background: linear-gradient(135deg,
    rgba(255, 179, 217, 0.35),
    rgba(201, 160, 255, 0.3)
  );
  border: 3px solid #c9a0ff;
  border-radius: 24px;
  padding: 1.8rem;
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.result-card:empty { display: none; }

.result-card.result-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card h3 {
  font-family: 'Pacifico', cursive;
  color: #ff2d78;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.result-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-card li {
  position: relative;
  padding: 0.5rem 0 0.5rem 2.2rem;
  font-weight: 600;
  color: #6a3d8b;
  border-bottom: 1px dashed rgba(201, 160, 255, 0.45);
}

.result-card li:last-child { border-bottom: none; }

.result-card li::before {
  content: '🐱';
  position: absolute;
  left: 0;
  top: 0.45rem;
  line-height: 1;
}

.result-card em {
  display: block;
  margin-top: 1rem;
  color: #c9a0ff;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==================== ERROR STATE ==================== */
.error-title {
  font-family: 'Pacifico', cursive;
  color: #ff2d78;
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
}

.error-msg {
  color: #7b2d8b;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ==================== SAVE NUDGE ==================== */
.save-nudge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  background: rgba(255, 179, 217, 0.2);
  border: 2px dashed #ffb3d9;
  border-radius: 16px;
  flex-wrap: wrap;
}

.save-nudge-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.save-nudge-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7b2d8b;
  line-height: 1.45;
  min-width: 140px;
}

.save-nudge-text strong {
  display: block;
  font-weight: 800;
  margin-bottom: 0.1rem;
}

.save-nudge-btn {
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, #ff2d78, #c9a0ff);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(255,45,120,0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.save-nudge-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(255,45,120,0.4);
}

/* ==================== RESET BUTTON ==================== */
.reset-btn {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.65rem 1.5rem;
  background: linear-gradient(135deg, #c9a0ff, #7fffd4);
  color: #5a2d6e;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(201, 160, 255, 0.4);
  transition: all 0.2s ease;
}

.reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(201, 160, 255, 0.55);
}

.reset-btn:active {
  transform: translateY(0);
}

/* ==================== ELEMENT INTRO ==================== */
.element-intro {
  font-size: 0.88rem;
  color: #a06bb0;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

/* ==================== STAT CARDS (age / weight) ==================== */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 1rem;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 179, 217, 0.22), rgba(201, 160, 255, 0.18));
  border: 2.5px solid #ffb3d9;
  border-radius: 20px;
  padding: 1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.2s;
}

.stat-card:focus-within {
  border-color: #ff6eb4;
  box-shadow: 0 0 0 4px rgba(255, 110, 180, 0.15);
}

.stat-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #c9a0ff;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-card input[type=number] {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #ffb3d9;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: #7b2d8b;
  outline: none;
  transition: border-color 0.2s;
}

.stat-card input[type=number]:focus {
  border-color: #ff6eb4;
}

/* ==================== WEIGHT ROW ==================== */
.weight-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.weight-row input {
  flex: 1;
  margin-top: 0;
  padding: 0.5rem 0.75rem;
  border: 2px solid #ffb3d9;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: #7b2d8b;
  outline: none;
  transition: border-color 0.2s;
}

.weight-row input:focus {
  border-color: #ff6eb4;
}

.weight-row select {
  width: 68px;
  margin-top: 0;
  padding: 0.5rem 0.3rem;
  border: 2px solid #ffb3d9;
  border-radius: 12px;
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: #7b2d8b;
  outline: none;
}

.unit-badge {
  width: 68px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.3rem;
  border: 2px solid #ffb3d9;
  border-radius: 12px;
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: #c9a0ff;
}

/* ==================== RECOMMENDATION CATEGORIES ==================== */
.rec-category {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px dashed rgba(201, 160, 255, 0.35);
}

.rec-category:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rec-category-title {
  font-family: 'Pacifico', cursive;
  font-size: 1rem;
  color: #c9a0ff;
  margin-bottom: 0.6rem;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.top-bar-auth {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.top-auth-out,
.top-auth-in {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-signin-btn {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #ffb3d9;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #7b2d8b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.top-signin-btn:hover {
  border-color: #ff6eb4;
  background: rgba(255, 179, 217, 0.3);
  transform: translateY(-1px);
}

.top-auth-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem 0.3rem 0.4rem;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #ffb3d9;
  border-radius: 50px;
  max-width: 180px;
}

.top-auth-avatar {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.top-auth-email {
  font-size: 0.78rem;
  font-weight: 800;
  color: #7b2d8b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Unified Sign In / Sign Out button */
.top-auth-toggle-btn {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid #ffb3d9;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #7b2d8b;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  transition: all 0.2s ease;
}

.top-auth-toggle-btn:hover {
  border-color: #ff6eb4;
  background: rgba(255, 179, 217, 0.3);
  transform: translateY(-1px);
}

.top-signout-btn {
  padding: 0.35rem 0.8rem;
  background: none;
  border: 1.5px solid #c9a0ff;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #a06bb0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.top-signout-btn:hover {
  border-color: #ff6eb4;
  color: #ff2d78;
}

/* ==================== SIGN-IN MODAL ==================== */
.signin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(90, 45, 110, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlay-in 0.2s ease;
}

.signin-modal-backdrop[hidden] { display: none !important; }

.signin-modal-box {
  position: relative;
  background: rgba(255, 250, 253, 0.97);
  border: 2.5px solid #ffb3d9;
  border-radius: 28px;
  padding: 2rem 2rem 1.75rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(201, 160, 255, 0.5);
  animation: modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

@keyframes modal-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.signin-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #c9a0ff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: #7b2d8b;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
}

.signin-modal-close:hover {
  background: rgba(201, 160, 255, 0.3);
  transform: rotate(90deg);
}

.signin-modal-cat {
  font-size: 3rem;
  line-height: 1;
}

.signin-modal-title {
  font-family: 'Pacifico', cursive;
  font-size: 1.25rem;
  color: #ff2d78;
  text-align: center;
}

.signin-modal-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a06bb0;
  text-align: center;
  line-height: 1.5;
}

.signin-modal-box .auth-email-input {
  width: 100%;
}

.signin-modal-box .auth-action-btn {
  width: 100%;
  text-align: center;
}

/* ── Auth shared ── */
.auth-email-input {
  flex: 1 1 160px;
  padding: 0.55rem 0.9rem;
  border: 2.5px solid #ffb3d9;
  border-radius: 50px;
  font-size: 0.9rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: #7b2d8b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-email-input:focus {
  border-color: #ff6eb4;
  box-shadow: 0 0 0 3px rgba(255,110,180,0.2);
}

.auth-action-btn {
  padding: 0.55rem 1.1rem;
  background: linear-gradient(135deg, #ff2d78, #c9a0ff);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(255,45,120,0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.auth-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(255,45,120,0.4);
}

.auth-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-msg {
  width: 100%;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 1.2em;
  text-align: center;
}

.auth-msg--ok  { color: #2d8b5a; }
.auth-msg--err { color: #ff2d78; }

/* ==================== CAT PROFILE CARD ==================== */
.profile-card {
  margin-bottom: 1.6rem;
}

.photo-label {
  margin-top: 1rem;
}

.photo-file-input {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-family: 'Nunito', sans-serif;
  color: #7b2d8b;
  cursor: pointer;
}

.cat-photo-preview {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffb3d9;
  margin-top: 0.75rem;
  box-shadow: 0 4px 14px rgba(255,110,180,0.3);
}

.profile-btn-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.profile-save-btn,
.profile-new-btn {
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-save-btn {
  background: linear-gradient(135deg, #ff6eb4, #c9a0ff);
  color: white;
  box-shadow: 0 3px 12px rgba(255,110,180,0.3);
}

.profile-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(255,110,180,0.4);
}

.profile-new-btn {
  background: rgba(201,160,255,0.2);
  color: #7b2d8b;
  border: 2px solid #c9a0ff;
}

.profile-new-btn:hover {
  background: rgba(201,160,255,0.35);
}

/* ==================== PHASE 4 FORM FIELDS ==================== */
.radio-fieldset {
  border: 2.5px dashed #c9a0ff;
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  margin-top: 1rem;
  background: rgba(201,160,255,0.07);
}

.radio-fieldset legend {
  font-weight: 800;
  color: #7b2d8b;
  padding: 0 0.5rem;
  font-size: 0.95rem;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  margin-right: 1.1rem;
  font-weight: 700;
  color: #7b2d8b;
  cursor: pointer;
  font-size: 0.95rem;
}

.radio-label input[type=radio] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid #c9a0ff;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  position: relative;
}

.radio-label input[type=radio]:checked {
  background: linear-gradient(135deg, #ff6eb4, #ff2d78);
  border-color: #ff2d78;
}

.checkbox-standalone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 700;
  color: #7b2d8b;
  cursor: pointer;
  font-size: 0.95rem;
}

.notes-textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 1rem;
  border: 2.5px solid #ffb3d9;
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  background: rgba(255,255,255,0.9);
  color: #7b2d8b;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}

.notes-textarea:focus {
  border-color: #ff6eb4;
  box-shadow: 0 0 0 4px rgba(255,110,180,0.22);
}

/* ==================== SHARE BAR ==================== */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, rgba(127,255,212,0.22), rgba(135,206,235,0.22));
  border: 2.5px solid #7fffd4;
  border-radius: 16px;
}

.share-label {
  font-weight: 800;
  color: #2d7b5a;
  font-size: 0.9rem;
  white-space: nowrap;
}

.share-input {
  flex: 1 1 200px;
  padding: 0.45rem 0.85rem;
  border: 2px solid #7fffd4;
  border-radius: 50px;
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  background: rgba(255,255,255,0.85);
  color: #2d5a7b;
  outline: none;
}

.share-btn {
  padding: 0.45rem 1.1rem;
  background: linear-gradient(135deg, #7fffd4, #87ceeb);
  color: #1a4a5a;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(127,255,212,0.4);
  transition: all 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(127,255,212,0.55);
}

/* ==================== REPORT PAGE ==================== */
.report-loading {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #c9a0ff;
}

.report-card {
  margin-top: 0;
}

.report-header-row {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.report-cat-photo {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffb3d9;
  box-shadow: 0 4px 14px rgba(255,110,180,0.3);
  flex-shrink: 0;
}

.report-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a06bb0;
  line-height: 1.8;
}

.report-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.report-back-link {
  text-decoration: none;
  display: inline-block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {

  /* ── iOS zoom prevention (must be 16px+) ── */
  input[type=text],
  input[type=number],
  input[type=email],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* ── Layout ── */
  .floaties { display: none; }

  .outer-wrapper {
    padding: 0.6rem 0 3rem;
  }

  .container {
    padding: 1rem 0.85rem 1.5rem;
    border-radius: 18px;
    margin: 0 0.5rem;
  }

  /* ── Top bar ── */
  .top-bar {
    margin-bottom: 0.85rem;
    gap: 0.4rem;
  }

  .shop-pill-btn {
    font-size: 0.8rem;
    padding: 0.38rem 0.85rem;
  }

  .top-signin-btn {
    font-size: 0.78rem;
    padding: 0.38rem 0.75rem;
  }

  .top-auth-pill {
    max-width: 110px;
    padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  }

  .top-auth-avatar { font-size: 1rem; }
  .top-auth-email  { font-size: 0.68rem; }

  .top-signout-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  /* ── Header ── */
  .site-header { margin-bottom: 1rem; }
  .header-cats { font-size: 1.5rem; letter-spacing: 0.1rem; }
  h1 { font-size: 1.5rem; }
  .subtitle { font-size: 0.88rem; }

  /* ── Cards ── */
  .card {
    padding: 1rem 0.9rem;
    border-radius: 16px;
    margin-bottom: 0.85rem;
  }

  .section-title { font-size: 1rem; margin-bottom: 0.85rem; }

  /* ── Labels ── */
  label {
    font-size: 0.88rem;
    margin-bottom: 0.7rem;
  }

  /* ── Inputs — 48px min tap target ── */
  input[type=text],
  input[type=number],
  input[type=email],
  select {
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
  }

  textarea {
    min-height: 80px;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
  }

  /* ── Stat cards ── */
  .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .stat-card {
    padding: 0.85rem 0.7rem 0.9rem;
  }

  .stat-icon  { font-size: 1.5rem; }
  .stat-label { font-size: 0.72rem; margin-bottom: 0.3rem; }

  .weight-row input,
  .weight-row select,
  .unit-badge {
    min-height: 44px;
    font-size: 0.9rem;
  }

  /* ── Complaints ── */
  .complaints { gap: 0.1rem; }
  .complaints label {
    display: flex;
    align-items: center;
    width: 100%;
    margin-right: 0;
    padding: 0.5rem 0.3rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  input[type=checkbox] {
    width: 1.4rem;
    height: 1.4rem;
    min-width: 1.4rem;
    flex-shrink: 0;
  }

  /* ── Radio fieldset ── */
  .radio-fieldset { padding: 0.8rem 0.9rem; gap: 0; }
  .radio-label {
    display: flex;
    align-items: center;
    width: 100%;
    margin-right: 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    min-height: 44px;
    border-bottom: 1px dashed rgba(201,160,255,0.25);
  }
  .radio-label:last-child { border-bottom: none; }

  /* ── Standalone checkbox ── */
  .checkbox-standalone {
    min-height: 44px;
    font-size: 0.9rem;
  }

  /* ── Element accordions ── */
  .element-group summary {
    padding: 0.85rem 0.9rem;
    font-size: 0.9rem;
    min-height: 48px;
  }

  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.5rem;
    padding: 0.75rem 0.7rem;
  }

  .checkbox-grid label {
    font-size: 0.82rem;
    gap: 0.3rem;
    min-height: 36px;
    align-items: center;
  }

  /* ── Submit button ── */
  .primary-btn {
    font-size: 0.95rem;
    padding: 0.95rem 1rem;
    width: 100%;
    max-width: 100%;
  }

  /* ── Result card ── */
  .result-card {
    padding: 1rem 0.9rem;
    border-radius: 16px;
  }
  .result-card h3 { font-size: 1.1rem; }
  .rec-category { margin-bottom: 0.85rem; }
  .rec-category-title { font-size: 0.9rem; }
  .result-card li { font-size: 0.88rem; }

  /* ── Save nudge ── */
  .save-nudge { gap: 0.55rem; padding: 0.75rem 0.85rem; }
  .save-nudge-icon { font-size: 1.3rem; }
  .save-nudge-text { font-size: 0.82rem; }
  .save-nudge-btn { width: 100%; text-align: center; padding: 0.55rem; }

  /* ── Share bar ── */
  .share-bar { flex-direction: column; gap: 0.5rem; }
  .share-input { width: 100%; }
  .share-btn { width: 100%; text-align: center; padding: 0.7rem; }

  /* ── Profile section ── */
  .profile-btn-row { flex-direction: column; }
  .profile-save-btn,
  .profile-new-btn { width: 100%; text-align: center; padding: 0.75rem; }

  /* ── Reset button ── */
  .reset-btn { width: 100%; text-align: center; padding: 0.75rem; margin-top: 1rem; }

  /* ── History ── */
  .history-toggle-btn { font-size: 0.88rem; padding: 0.75rem 1rem; }
  .history-card { padding: 0.85rem 0.9rem; }
  .history-cat-name { font-size: 0.88rem; }

  /* ── Sign-in modal ── */
  .signin-modal-backdrop { padding: 0.75rem; align-items: flex-end; }
  .signin-modal-box {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 24px 24px 20px 20px;
    max-width: 100%;
  }
  .signin-modal-cat   { font-size: 2.5rem; }
  .signin-modal-title { font-size: 1.1rem; }
  .signin-modal-sub   { font-size: 0.82rem; }
}

/* ==================== PRINT ==================== */
@media print {
  .floaties,
  .top-bar,
  .signin-modal-backdrop,
  .report-actions,
  .share-bar { display: none !important; }

  html {
    background: white;
    animation: none;
  }

  .outer-wrapper {
    padding: 0;
  }

  .container {
    box-shadow: none;
    border-radius: 0;
    backdrop-filter: none;
    background: white;
  }

  .result-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  h1 {
    -webkit-text-fill-color: #ff2d78;
    animation: none;
  }
}
