/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-primary: #6366F1; /* Base purple */
    --brand-primary-hover: #4f46e5; /* Darker purple */
    /* Additional brand shades for richer UI */
    --brand-100: #eef2ff;
    --brand-500: #6366F1;
    --brand-600: #585CF0;
    --brand-700: #4f46e5;

    --brand-secondary: #e5e7eb; /* Light gray border */
    --text-primary: #1f2937; /* Dark text */
    --text-secondary: #6b7280; /* Medium gray text */
    --bg-primary: #FFFFFF; /* White */
    --bg-secondary: #f9fafb; /* Light gray page background */
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #ffffff;
    background-image:
      radial-gradient(1200px 400px at 20% -10%, #eef2ff 0%, rgba(238,242,255,0) 60%),
      radial-gradient(800px 300px at 90% 0%, #ede9fe 0%, rgba(237,233,254,0) 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Let main content push footer to the bottom */
.page-main, main { flex: 1 0 auto; }
footer { flex: 0 0 auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    color: var(--text-primary);
    padding: 1.0rem 0;
    margin: -20px -20px 2rem -20px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid var(--brand-secondary);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    height: 36px; /* match landing header h-9 */
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    display: none; /* Keep until loaded */
}

.brand-logo.loaded { display: block; }

.brand-title { font-weight: 800; letter-spacing: -0.02em; font-size: 1.5rem; }

.nav-brand h1 {
    color: var(--text-primary);
    font-size: 2.0rem;
    margin: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#user-status {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Hide user status on phones */
@media (max-width: 639px) {
    #user-status {
        display: none;
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
}

/* Card Styles */
.card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--brand-secondary);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-ghost { background: transparent; color: var(--brand-primary); border: 2px solid transparent; }
.btn-ghost:hover { background: #f3f4ff; border-color: var(--brand-primary); }

button:disabled, .btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.6; cursor: not-allowed; box-shadow: none; transform: none;
}

/* Small button variant for header controls */
.btn-sm { padding: 8px 12px; font-size: .9rem; border-radius: 8px; }

/* Icon-only header buttons (no background) */
.icon-btn { background: transparent; border: none; padding: 6px; color: var(--text-primary); display:inline-flex; align-items:center; justify-content:center; border-radius: 8px; }
.icon-btn:hover { color: var(--brand-700); background: transparent; box-shadow: none; transform: none; }
.icon-btn svg { width: 22px; height: 22px; display: block; }

.btn-primary {
    background: var(--brand-600);
    color: white;
    border: 2px solid var(--brand-600);
}

.btn-primary:hover {
    background: var(--brand-700);
    border-color: var(--brand-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: var(--brand-600);
    color: white;
    border: 2px solid var(--brand-600);
}

.btn-secondary:hover {
    background: var(--brand-700);
    color: white;
    border-color: var(--brand-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Re-skinning .btn-success to be the new primary button */
.btn-success {
    background: var(--brand-600);
    color: white;
    border: 2px solid var(--brand-600);
}

.btn-success:hover {
    background: var(--brand-700);
    border-color: var(--brand-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Auth Styles */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--brand-secondary);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--brand-primary);
    border-bottom: 3px solid var(--brand-primary);
    font-weight: 600;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 14px 16px; /* larger to match pantry text box */
    border: 2px solid var(--brand-secondary);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
    font-family: inherit;
    min-height: 46px; /* ensure same visual height as the large text box */
    box-sizing: border-box;
}

/* Custom select to visually match text inputs */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    padding: 16px 48px 16px 16px; /* tall like text box; space for chevron */
    min-height: 50px;
}

::placeholder { color: #9aa3af; }

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Pricing Plans */
.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.plan {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    border: 2px solid var(--brand-secondary);
    transition: all 0.3s ease;
}

.plan:hover {
    border-color: var(--brand-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.1);
}

.plan.featured {
    background: var(--brand-primary);
    color: white;
    transform: scale(1.02);
    border: 2px solid var(--brand-primary);
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.price span {
    font-size: 1rem;
    opacity: 0.7;
}

.plan ul {
    list-style: none;
    margin: 1.5rem 0;
}

.plan ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--brand-secondary);
}

.plan.featured ul li {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Modern Profile Setup */
.profile-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.profile-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    font-weight: 300;
}

.profile-section {
    margin-bottom: 3rem;
    position: relative;
}

.section-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modern-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-card {
    background: var(--bg-secondary);
    border: 2px solid var(--brand-secondary);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.option-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-primary);
    background: #f0f0ff; /* Light purple-white */
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.option-card.selected {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
}

.option-card.selected .option-emoji {
    transform: scale(1.2);
}

.option-emoji {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.option-text {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}

.profile-actions {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bg-secondary);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.settings-section small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Ingredient input and suggestions */
 .ingredient-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0; /* allow input to shrink nicely next to buttons */
}

.ingredient-input-wrap input {
    /* Fully rounded input for better aesthetics */
    border-bottom: 2px solid var(--brand-secondary);
    border-radius: 8px;
}

.ingredient-suggest-list {
    position: static; /* stack below input; pushes content instead of overlaying */
    background: var(--bg-primary);
    border: 2px solid var(--brand-secondary);
    border-radius: 12px; /* fully rounded */
    margin-top: 8px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    z-index: 1;
    display: none; /* hidden by default; shown when typing */
    flex-wrap: wrap;
    gap: 6px;
}

.ingredient-suggest-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    text-align: left;
    padding: 6px 10px;
    margin: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--brand-secondary);
    border-radius: 999px; /* pill */
    cursor: pointer;
    white-space: nowrap;
}

.ingredient-suggest-item:hover, .ingredient-suggest-item.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pantry-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-600);
    color: white;
    border: 2px solid var(--brand-700);
    padding: 6px 10px;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
}

.pantry-tag button {
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
}

/* Shopping List Modern Design */
.shopping-header {
    text-align: center;
    margin-bottom: 2rem;
}

.shopping-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.recipe-preview-card {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.recipe-preview-card h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.shopping-list-container {
    margin: 2rem 0;
}

.shopping-items-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.ingredient-item {
    background: var(--bg-secondary);
    border: 2px solid var(--brand-secondary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.ingredient-item:hover {
    border-color: var(--brand-primary);
    background: #f0f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.ingredient-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.ingredient-item label {
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
}

.ingredient-item input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    opacity: 0.6;
}

.shopping-actions {
    text-align: center;
    margin-top: 3rem;
}

/* AI Cooking Assistant Modern Design */
.cooking-assistant-modern {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--brand-secondary);
}

.cooking-header {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--brand-secondary);
}

.cooking-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.cooking-header .btn-secondary {
    border-color: var(--brand-secondary);
}

.cooking-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.cooking-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.recipe-info-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--brand-primary);
}

.step-card {
    background: var(--bg-primary);
    border: 2px solid var(--brand-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.step-header {
    margin-bottom: 1rem;
}

.step-badge {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.step-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.step-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.control-btn {
    background: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.control-btn:hover {
    background: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Keep .next selector for compatibility */
.control-btn.next {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.control-btn.next:hover {
    background: var(--brand-primary-hover);
}

.cooking-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.chat-card {
    background: var(--bg-primary);
    border: 2px solid var(--brand-secondary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.chat-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    padding: 1.5rem;
}

.chat-header h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.chat-messages-modern {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
}

.chat-message.user {
    background: var(--brand-primary);
    color: white;
    margin-left: auto;
    text-align: left; /* User text aligns left for readability */
}

.chat-message.assistant {
    background: var(--bg-primary);
    border: 2px solid var(--brand-secondary);
    color: var(--text-primary);
}

.chat-input-modern {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 2px solid var(--brand-secondary);
    background: var(--bg-primary);
}

.chat-input-modern input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--brand-secondary);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.chat-input-modern input:focus {
    border-color: var(--brand-primary);
}

.send-btn {
    width: 50px;
    height: 50px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--brand-primary-hover);
    transform: scale(1.1);
}

/* Cooking Choice Cards */
.choice-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.choice-card {
    background: var(--bg-secondary);
    border: 2px solid var(--brand-secondary);
    border-radius: 16px;
    padding: 1.25rem 1rem; /* reduced to keep height compact */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-card:hover, .choice-card:focus {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    background: #f0f0ff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    outline: none;
}

.choice-emoji {
    font-size: 2rem;
    margin: 0 auto 0.75rem auto;
    width: 56px; height: 56px; display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    color: white;
}

.choice-desc {
    color: var(--text-secondary);
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
}

.choice-cta {
    margin-top: 0.5rem;
}

/* Account Dashboard */
.account-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.subscription-status, .usage-stats {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--brand-secondary);
}

/* Toast notifications */
#toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 2500; align-items: center; }
.toast { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:12px; border:1px solid var(--brand-secondary); background:#ffffff; color: var(--text-primary); box-shadow:0 10px 25px rgba(0,0,0,.08); max-width: 360px; opacity:0; transform: translateY(-8px); transition: opacity .22s ease-out, transform .22s ease-out; }
.toast.show { opacity:1; transform: translateY(0); }
.toast-out { opacity:0 !important; transform: translateY(-8px) !important; transition: opacity .18s ease-in, transform .18s ease-in; }
.toast .title { font-weight: 800; letter-spacing:-0.01em; }
.toast .msg { font-size:.95rem; }
.toast-success { border-color:#22c55e33; background:#ecfdf5; color:#065f46; }
.toast-error { border-color:#ef444433; background:#fef2f2; color:#7f1d1d; }
.toast-info { border-color:#6366f133; background:#eef2ff; color:#312e81; }
.toast-close { background:transparent; border:none; color:inherit; cursor:pointer; margin-left:auto; font-size:1.1rem; }

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85); /* Lighter background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: var(--text-primary);
    backdrop-filter: blur(6px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(99, 102, 241, 0.2); /* Light purple */
    border-top: 5px solid var(--brand-primary); /* Main purple */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typography Improvements */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Add subtle purple accents */
.card h2 {
    color: var(--brand-primary);
}
.section-icon {
    color: var(--brand-primary);
}

h1 {
    font-size: 2.6rem;
    font-weight: 800;
}

h2 {
    margin-bottom: 1.25rem;
    font-size: 2.0rem;
}

.card h2 { font-size: 1.9rem; }
.section-desc { font-size: 1.1rem; }

h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Smooth Animations */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Improved Spacing */
.container {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header overrides for Tailwind-only pages */
header.no-app-header { padding: 0 !important; margin: 0 !important; box-shadow: none !important; border-bottom: 1px solid var(--brand-secondary); }
.welcome-user { color: var(--text-secondary); margin-right: .25rem; font-weight: 500; }

/* Choices page title */
.choices-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: .5rem; }
@media (min-width: 768px) { .choices-title { font-size: 2.2rem; } }
#cooking-choice .section-desc { font-size: 1.05rem; color: var(--text-secondary); }

/* Make the choices card shallower than it is wide */
#cooking-choice.card { padding: 1.5rem 2rem; }

/* Cooking assistant title */
.cooking-title { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 640px) {
  .cooking-title { font-size: 1.7rem; }
  #new-recipe { padding: 6px 10px; font-size: 0.9rem; border-radius: 8px; }
}

/* Auth pages */
.auth-hero { background: radial-gradient(1200px 400px at 20% -10%, #eef2ff 0%, transparent 60%), radial-gradient(800px 300px at 90% 0%, #ede9fe 0%, transparent 60%); padding: 2rem 0 3rem; }
.auth-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; }
.auth-side { text-align: center; }
.auth-title { font-size: 2.2rem; font-weight: 800; letter-spacing:-0.02em; }
.auth-sub { color: var(--text-secondary); margin-top:.25rem; }
.benefits { margin-top: .9rem; color: var(--text-secondary); display:grid; gap:.35rem; font-size:.98rem; }
.chip-row { display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center; margin-top: .75rem; }
.chip { display:inline-flex; align-items:center; gap:.5rem; padding:.4rem .7rem; border-radius:999px; background:#eef2ff; color:#4f46e5; font-weight:600; font-size:.9rem; }
.auth-card { max-width: 480px; margin: 0 auto; background: white; border: 1px solid var(--brand-secondary); box-shadow: 0 10px 30px rgba(99,102,241,.08); }
.link-small { color: var(--brand-primary); text-decoration: none; font-size: .9rem; }
.link-small:hover { text-decoration: underline; }

@media (min-width: 992px) {
  .auth-layout { grid-template-columns: 1.1fr 1fr; }
  .auth-side { text-align: left; }
}

/* Simple modal */
.sc-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:2400}
.sc-modal{background:#fff;border:1px solid var(--brand-secondary);border-radius:16px;box-shadow:0 24px 50px rgba(0,0,0,.18);max-width:560px;width:92%;padding:1.25rem 1.25rem 1rem}
.sc-modal-title{font-weight:800;letter-spacing:-0.02em;color:var(--text-primary);font-size:1.25rem;margin-bottom:.35rem}
.sc-modal-sub{color:var(--text-secondary);font-size:.95rem;margin:.25rem 0 .75rem}
.sc-modal-body{color:var(--text-primary);font-size:1rem;line-height:1.5}
.sc-modal-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.5rem 0 .5rem}
.sc-modal-actions{display:flex;gap:.6rem;justify-content:flex-end;margin-top:1rem}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cooking-layout {
        grid-template-columns: 1fr;
    }
    
    .cooking-sidebar {
        position: static;
        top: auto;
    }
    
    .step-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
        margin: 0 1rem;
    }
    
    .nav-brand {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .brand-logo {
        height: 40px;
    }
    
    .nav-brand h1 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .modern-options {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .option-card {
        padding: 1rem 0.5rem;
    }
    
    .option-emoji {
        font-size: 1.2rem;
    }
    
    .option-text {
        font-size: 0.8rem;
    }
    
    .pricing-plans {
        grid-template-columns: 1fr;
    }
    
    .plan.featured {
        transform: none;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .card {
        padding: 1.5rem 1rem;
    }
    
    .btn-primary, .btn-secondary, .btn-success {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
    }

    .btn-large {
        width: 100%;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
    }
    
    .nav-links .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .step-controls {
        grid-template-columns: 1fr;
    }

    .control-btn {
        padding: 1rem;
    }
}
