@import url('https://fonts.googleapis.com/css2?family=Freehand&family=Inter:wght@300;400;600&display=swap');

/* design tokens */
:root{
  --page-bg: #1a1a1a;
  --accent: #FF5900;
  --muted: #cfcfcf;
  --text: #ffffff;
  --card-radius: 40px;
  --btn-radius: 20px;
  --max-width: 1086px;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* base layout (shared across all pages) */
html,body{min-height:100%;}
body{
  margin:0;
  min-height:100vh;
  background:var(--page-bg);
  color:var(--text);
  font-family:var(--font-body);
  display:flex;
  align-items:stretch;
  justify-content:center;
  padding:2rem 2rem 0 2rem;
  box-sizing:border-box;
}

.page-wrap{
  width:100%;
  max-width:var(--max-width);
  display:flex;
  flex-direction:column;
}

.logo{
  font-family: 'Freehand', cursive;
  font-size: 30px;
  font-weight: 400;
  color: #FFFFFF;
  text-align: center;
  line-height: 100%;
  letter-spacing: 0%;
  margin-bottom:1.5rem;
}

/* landing page */
.hero-card{
  position:relative;
  width:100%;
  flex:1 1 auto;
  min-height:0;
  border-radius:56px 56px 0 0;
  background-image: url('images/bg.png');
  background-size: cover;
  background-position: center 30%;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.hero-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.5);
}

.hero-content{
  position:relative;
  z-index:1;
  text-align:center;
  padding:0 2rem;
  max-width:830px;
}

h1{
  font-family:var(--font-body);
  font-weight:400;
  font-size:2.75rem;
  line-height:1.2;
  margin:0 0 1.25rem 0;
}

.underline-accent{
  position:relative;
  display:inline-block;
}
.underline-svg{
  position:absolute;
  left:0;
  bottom:-12px;
  width:100%;
  height:auto;
  pointer-events:none;
}

p.lead{
  font-weight:300;
  font-size:1.375rem;
  line-height:1.5;
  color:rgba(255,255,255,0.9);
  margin:0 auto 1.75rem auto;
}

.hero-content .btn{
  margin-top:4rem;
}

.btn{
  display:inline-block;
  width:198px;
  height:53px;
  line-height:53px;
  background:var(--accent);
  color:#fff;
  border-radius:var(--btn-radius);
  text-decoration:none;
  font-weight:400;
  font-size:30px;
  border:0;
  font-family:var(--font-body);
  box-sizing:border-box;
  cursor:pointer;
  text-align:center;
}

@media (max-width:768px){
  body{
    padding:1.5rem 1.5rem 0 1.5rem;
  }
  h1{font-size:2rem}
  p.lead{font-size:1.1rem}
}

/* onboarding page */
.onboard-card{
  background:#181818;
  border-radius:40px 40px 0 0;
  padding:2.5rem;
  width:100%;
  max-width:800px;
  margin:2rem auto;
}

.onboarding-header{position:relative;display:flex;justify-content:center;align-items:center}
.back-arrow{
  position:absolute;
  left:0;
  color:var(--text);
  text-decoration:none;
  font-size:1.4rem;
}

.onboarding-title{
  font-family:var(--font-body);
  font-weight:400;
  font-size:1.8rem;
  text-align:center;
  margin:1.75rem 0 1.5rem 0;
}

.panel{
  background:#202020;
  border-radius:30px;
  padding:1.75rem;
  max-width:740px;
  margin:0 auto;
}

form .section{margin-top:0}
form .section + .section{margin-top:1.5rem}
label.section-title{display:block;color:var(--text);font-weight:600;margin-bottom:0.75rem;font-size:0.95rem}
.hint{color:var(--muted);font-weight:400;font-style:italic;margin-left:0.3rem;font-size:0.85rem}

.cuisine-grid{display:grid;grid-template-columns:1fr 1fr;gap:0.75rem}

.cuisine-toggle{
  position:relative;
  display:block;
  width:100%;
  height:139px;
  border-radius:20px;
  background-size:cover;
  background-position:center;
  background-color:#333;
  cursor:pointer;
  overflow:hidden;
  box-shadow:0 0 0 2px transparent;
}
.cuisine-toggle::before{
  content:'';
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.6);
}
.cuisine-toggle input{display:none}
.cuisine-label{
  position:absolute;
  left:14px;
  bottom:10px;
  color:#fff;
  font-weight:600;
  font-size:0.95rem;
  z-index:1;
}
.cuisine-toggle:has(input:checked){
  box-shadow:0 0 0 2px var(--accent);
}

.cuisine-italian { background-image: url('images/cuisine-italian.png'); }
.cuisine-mexican { background-image: url('images/cuisine-mexican.png'); }
.cuisine-chinese { background-image: url('images/cuisine-chinese.png'); }
.cuisine-thai    { background-image: url('images/cuisine-thai.png'); }
.cuisine-indian  { background-image: url('images/cuisine-indian.png'); }
.cuisine-french  { background-image: url('images/cuisine-french.png'); }

.range-row{display:flex;align-items:center;gap:0.75rem}
input[type=range]{
  flex:1;
  -webkit-appearance:none;
  height:3px;
  background:#7C7C7C;
  border-radius:2px;
}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#D9D9D9;
  cursor:pointer;
}
input[type=range]::-moz-range-thumb{
  width:22px;
  height:22px;
  border-radius:50%;
  background:#D9D9D9;
  border:none;
  cursor:pointer;
}
output{
  min-width:70px;
  text-align:center;
  color:var(--text);
  font-style:italic;
  background:#000;
  padding:0.6rem 0.75rem;
  border-radius:8px;
  font-size:0.9rem;
}

.allergens-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:0.6rem}
.toggle{
  position:relative;
  background-color:#333;
  background-size:cover;
  background-position:center;
  width:100%;
  height:69px;
  border-radius:20px;
  overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  box-shadow:0 0 0 2px transparent;
}
.toggle::before{
  content:'';
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.6);
}
.toggle input{display:none}
.toggle span{
  position:relative;
  z-index:1;
  color:#fff;
  font-weight:600;
  font-size:0.9rem;
}
.toggle:has(input:checked){box-shadow:0 0 0 2px var(--accent)}

.toggle-dairy     { background-image: url('images/milk.png'); background-position: top center; }
.toggle-gluten    { background-image: url('images/wheat.png'); }
.toggle-shellfish { background-image: url('images/shellfish.png'); }
.toggle-eggs      { background-image: url('images/eggs.png'); }
.toggle-nuts      { background-image: url('images/nuts.png'); }
.toggle-soy       { background-image: url('images/soy.png'); }

.form-actions{display:flex;justify-content:flex-start;margin-top:1.75rem}

@media (max-width:600px){
  .onboard-card{padding:1.25rem}
  .cuisine-grid{grid-template-columns:1fr}
  .allergens-grid{grid-template-columns:1fr 1fr}
}

/* login / signup pages */
body.auth-page{background:#2F2F2F;}

.auth-heading{
  font-family:var(--font-body);
  font-weight:400;
  font-size:2.5rem;
  text-align:center;
  color:var(--text);
  max-width:480px;
  margin:1.75rem auto 1.5rem auto;
}

.auth-card{
  background:#202020;
  border-radius:30px;
  width:480px;
  max-width:100%;
  box-sizing:border-box;
  padding:2.5rem;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.25rem;
}

.auth-label{
  font-family:var(--font-body);
  font-weight:400;
  font-size:1.5rem;
  color:var(--muted);
}

.auth-avatar{
  width:90px;
  height:90px;
  border-radius:50%;
  object-fit:cover;
}

.auth-input{
  width:100%;
  height:56px;
  border-radius:12px;
  background:#2F2F2F;
  border:0;
  color:#fff;
  font-family:var(--font-body);
  font-size:1rem;
  padding:0 1.5rem;
  box-sizing:border-box;
}
.auth-input::placeholder{
  font-style:italic;
  font-weight:300;
  font-size:1rem;
  color:rgba(255,255,255,0.6);
}

.auth-button{
  display:inline-block;
  width:100%;
  height:53px;
  line-height:53px;
  background:var(--accent);
  color:#fff;
  border-radius:var(--btn-radius);
  border:0;
  font-family:var(--font-body);
  font-weight:400;
  font-size:1.25rem;
  box-sizing:border-box;
  cursor:pointer;
  text-align:center;
  text-decoration:none;
}

.auth-footer{
  font-family:var(--font-body);
  font-size:1rem;
  color:#949494;
  text-align:center;
  margin:0;
}
.auth-link{
  color:var(--accent);
  text-decoration:underline;
}

@media (max-width:600px){
  .auth-heading{font-size:2rem}
  .auth-card{padding:2rem 1.5rem}
  .auth-label{font-size:1.5rem}
  .auth-input::placeholder{font-size:1rem}
  .auth-footer{font-size:1.1rem}
}

/* plan page */
.top-row{
  max-width:740px;
  margin:0 auto 1rem auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:var(--muted);
  font-size:0.9rem;
}

.day-tabs{
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
  margin-bottom:1.5rem;
}
.day-tab{
  background:#7C7C7C;
  color:#fff;
  border:0;
  padding:0.6rem 1.1rem;
  border-radius:20px;
  cursor:pointer;
  font-weight:600;
  font-size:0.9rem;
}
.day-tab.active{background:#FF5900;}

.day-content{display:none}
.day-content.visible{display:block}

.meal-heading{
  font-family:var(--font-body);
  font-size:2.5rem;
  font-weight:400;
  text-align:center;
  margin:1.25rem 0 0.6rem 0;
}
.meal-heading:first-of-type{margin-top:0}

.meal-card{
  position:relative;
  background:#000;
  border-radius:20px;
  overflow:hidden;
  width:100%;
  max-width:514px;
  min-height:201px;
  margin:0 auto;
}
.meal-card::before{
  content:'';
  position:absolute;
  inset:0;
  background-image:var(--recipe-bg);
  background-size:cover;
  background-position:center;
  filter:blur(8px) brightness(0.45);
  transform:scale(1.15);
  opacity:0;
  transition:opacity 0.2s ease;
  z-index:0;
}
.meal-card[open]::before{
  opacity:1;
}
.meal-card summary{
  list-style:none;
  cursor:pointer;
  position:relative;
  z-index:1;
  display:block;
  height:201px;
  padding:1.1rem 1.25rem;
  box-sizing:border-box;
  font-weight:600;
  color:var(--text);
  background-image:linear-gradient(rgba(0,0,0,0.45),rgba(0,0,0,0.45)), var(--recipe-bg);
  background-size:cover;
  background-position:center;
}
.meal-card[open] summary{
  background-image:none;
}
.meal-card summary::-webkit-details-marker{display:none}
.meal-card summary::after{
  content:'\2304';
  position:absolute;
  right:1.1rem;
  bottom:0.85rem;
  width:48px;
  text-align:center;
  font-size:2.25rem;
  transform:scaleX(1.4);
  color:var(--muted);
  transition:transform 0.2s ease;
}
.meal-card[open] summary::after{
  transform:scaleX(1.4) rotate(180deg);
}

.meal-summary-left{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  height:100%;
  max-width:80%;
}
.meal-title{
  font-size:1.15rem;
  font-weight:600;
  color:#fff;
}
.meal-cuisine{
  font-size:0.9rem;
  font-weight:400;
  color:rgba(255,255,255,0.85);
  text-transform:capitalize;
}

.fav-star{
  position:absolute;
  top:1.1rem;
  right:1.1rem;
  width:48px;
  height:46px;
  background:none;
  border:0;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  cursor:pointer;
  flex-shrink:0;
  box-sizing:border-box;
}
.fav-star.favorited svg{fill:currentColor}

.meal-body{
  position:relative;
  z-index:1;
  padding:0 1.25rem 1.25rem 1.25rem;
  color:var(--muted);
  font-size:0.9rem;
  line-height:1.5;
}
.meal-body ul{
  margin:0.25rem 0 1rem 0;
  padding-left:1.25rem;
}
.meal-label{
  color:var(--text);
  font-weight:600;
  margin:0.75rem 0 0.2rem 0;
}

/* favorites page */
.favorites-heading{
  font-family:var(--font-body);
  font-weight:400;
  font-size:3.75rem;
  text-align:center;
  color:var(--text);
  margin:0 0 1.5rem 0;
}
.favorites-list{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

/* responsive: tablet & phone */
@media (max-width:900px){
  .meal-heading{font-size:2rem}
  .favorites-heading{font-size:2.75rem}
  .meal-title{font-size:1.05rem}
}

@media (max-width:480px){
  .meal-heading{font-size:1.5rem}
  .favorites-heading{font-size:2rem}
  .meal-card summary{height:auto;min-height:160px;padding:0.9rem 1rem}
  .meal-title{font-size:1rem}
  .meal-cuisine{font-size:0.8rem}
  .fav-star{width:40px;height:40px;top:0.75rem;right:0.75rem}
  .fav-star svg{width:22px;height:22px}
  .meal-card summary::after{width:40px;right:0.9rem;bottom:0.7rem;font-size:1.75rem}
  .day-tab{padding:0.5rem 0.85rem;font-size:0.8rem}
  .top-row{flex-direction:column;align-items:flex-start;gap:0.25rem}
}

/* loading spinner */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.loading-box {
  text-align: center;
  padding: 32px;
  color: white;
}

.loading-overlay.active {
  display: flex;
}

.loading-box {
  text-align: center;
  padding: 32px;
}

.loading-box h2 {
  margin: 18px 0 8px;
}

.loading-box p {
  margin: 0;
  opacity: 0.7;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 5px solid #dddddd;
  border-top-color: #222222;
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* bottom nav bar */
.bottom-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2.5rem;
  width:220px;
  max-width:100%;
  margin:1.5rem auto 0 auto;
  background:#000;
  border-radius:24px;
  padding:0.9rem 1.5rem;
  box-sizing:border-box;
}
.nav-btn{
  background:none;
  border:0;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#616161;
  text-decoration:none;
  cursor:pointer;
}
.nav-btn.active{
  color:#fff;
}
.nav-btn.nav-account img{
  width:26px;
  height:26px;
  border-radius:50%;
  object-fit:cover;
}
.nav-btn.nav-account.active img{
  filter:brightness(0) invert(1);
}

/* login/signup modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.7);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1.5rem;
  z-index:100;
  box-sizing:border-box;
}
.modal-overlay[hidden]{display:none}

.modal-wrap{
  width:100%;
  max-width:400px;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.modal-heading{
  font-family:var(--font-body);
  font-weight:400;
  font-size:1.5rem;
  color:var(--text);
  text-align:center;
  margin:0 0 1rem 0;
}

.modal-card{
  width:100%;
  background:#202020;
  border-radius:30px;
  padding:2rem;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.1rem;
}
.modal-card .auth-label{font-size:1.25rem}
.modal-card .auth-avatar{width:80px;height:80px}
.modal-card .auth-input{height:56px}
.modal-card .auth-input::placeholder{font-size:1rem}
.modal-card .auth-footer{font-size:0.95rem}
.modal-card .auth-button{width:198px}

.modal-cancel,
.modal-skip{
  background:none;
  border:0;
  color:var(--muted);
  text-decoration:underline;
  font-family:var(--font-body);
  font-size:0.9rem;
  cursor:pointer;
  padding:0;
}

/* profile page */
.profile-card{
  background:#202020;
  border-radius:30px;
  padding:2.5rem 2rem;
  max-width:520px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.1rem;
}
.profile-title{
  font-family:var(--font-body);
  font-weight:400;
  font-size:1.8rem;
  color:var(--text);
  margin:0;
}
.profile-avatar{
  width:100px;
  height:100px;
  border-radius:50%;
  object-fit:cover;
}
.profile-email{
  color:var(--muted);
  font-size:1rem;
  margin:0 0 0.5rem 0;
}
.profile-btn{
  width:200px;
  max-width:100%;
  background:#000;
  color:#fff;
  border:0;
  border-radius:14px;
  padding:0.9rem;
  font-family:var(--font-body);
  font-size:1rem;
  text-decoration:none;
  text-align:center;
  box-sizing:border-box;
}
.profile-signout{
  color:var(--accent);
  text-decoration:underline;
  font-family:var(--font-body);
  font-size:1rem;
  margin-top:1.5rem;
}