/* DishFinder Design System */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5049d3;
    --primary-hover: #3f39b8;
    --primary-light: rgba(80, 73, 211, 0.3);
    --text-primary: #000;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --text-muted: #605e5e;
    --border-color: #d8dadc;
    --border-light: #e6ebf2;
    --bg-white: #fff;
    --bg-light: #fefffc;
    --shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 4px 12px rgba(80, 73, 211, 0.3);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 28px;
    --radius-xl: 50px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-white);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

a.btn:hover {
    opacity: 1;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

h1 { font-size: 48px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
    opacity: 1;
}

.header-nav a.active {
    color: var(--primary);
    font-weight: 600;
}

.header-collapse {
    display: contents;
}
    display: contents;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    opacity: 1;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    opacity: 1;
}

.btn-light {
    background: var(--primary-light);
    color: var(--text-primary);
}

.btn-light:hover {
    background: rgba(80, 73, 211, 0.4);
    opacity: 1;
}

.btn-icon {
    padding: 8px 10px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: auto;
}

.btn-icon:hover {
    background: #f9f9ff;
    border-color: var(--primary);
    opacity: 1;
}

.btn-lg {
    padding: 17px 40px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 350px;
    background: url('https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=1920&h=400&fit=crop') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 60px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.hero h1 {
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    line-height: 1.6;
}

/* ===== Auth Pages (Full screen with background) ===== */
.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-background {
    position: fixed;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=1920&h=1080&fit=crop') center/cover;
    filter: brightness(0.45);
    z-index: -1;
}

.auth-container {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 80px 34px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1084px;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-content {
    max-width: 892px;
    margin: 0 auto;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--text-primary);
    text-decoration: none;
}

.auth-back:hover {
    transform: translateX(-5px);
}

.auth-back svg {
    width: 18px;
    height: 30px;
}

.auth-logo {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo svg {
    width: 100px;
    height: 100px;
    fill: white;
}

.auth-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 30px;
    text-align: center;
    letter-spacing: -0.3px;
    margin-bottom: 13px;
}

.auth-subtitle {
    font-size: 17px;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.25;
    margin-bottom: 37px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 25px;
    max-width: 100%;
    overflow: hidden;
}

.form-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.25;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-control {
    width: 100%;
    max-width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    line-height: 1.25;
    transition: all 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(80, 73, 211, 0.1);
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    gap: 10px;
    transition: all 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(80, 73, 211, 0.1);
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-wrapper input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Приховати вбудовану іконку очі у Edge/Chrome */
input::-ms-reveal,
input::-ms-clear,
input::-webkit-credentials-auto-fill-button {
    display: none !important;
}

/* Global: prevent any input/select/textarea from overflowing its container */
input, select, textarea {
    max-width: 100%;
    box-sizing: border-box;
}

.input-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.input-icon:hover {
    opacity: 1;
}

.form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.form-help {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== Social Buttons ===== */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 40px;
}

.social-button {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 17px 19px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.social-button:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.social-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-text {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
}

.social-icons-row {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.social-icon-btn {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 108px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.social-icon-btn:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 35px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== Footer Text ===== */
.auth-footer {
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

/* ===== Main Content Layout ===== */
.main-content {
    display: flex;
    padding: 30px 60px;
    gap: 52px;
}

/* ===== Sidebar / Filters ===== */
.sidebar {
    width: 311px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.sidebar-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 18px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-title {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #929292;
    margin-bottom: 10px;
}

.filter-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option:hover {
    transform: translateX(3px);
}

.filter-option label {
    font-size: 14px;
    cursor: pointer;
}

.filter-option.highlight label {
    color: var(--primary);
}

/* ===== Checkbox ===== */
.checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox.checked {
    background: var(--primary);
}

.checkbox.checked::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ===== Sidebar Buttons ===== */
.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.sidebar-btn {
    width: 100%;
    padding: 17px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-btn.primary {
    background: var(--primary);
    color: white;
}

.sidebar-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.sidebar-btn.secondary {
    background: var(--primary-light);
    color: var(--text-primary);
}

.sidebar-btn.secondary:hover {
    background: rgba(80, 73, 211, 0.4);
}

.filter-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.filter-icon:hover {
    transform: rotate(15deg);
}

/* ===== Quick Links ===== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-link-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7c75e8 100%);
    color: white;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    opacity: 1;
}

.quick-link-icon {
    font-size: 24px;
}

.quick-link-card span:not(.quick-link-icon) {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

/* ===== Tips Grid ===== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.tip-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    opacity: 1;
}

.tip-category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tip-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== Content Area ===== */
.content-area {
    flex: 1;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 25px;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-bar input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
}

.section-header a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
    text-decoration: none;
}

/* ===== Recipe Cards ===== */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.recipe-card {
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.recipe-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f5f5f5;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Recipe Card Large ===== */
.recipe-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.recipe-card-large {
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.recipe-card-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.recipe-large-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f5f5f5;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-large-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-large-info {
    padding: 5px 0;
}

.recipe-large-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.recipe-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c4c4c4;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Footer ===== */
.footer {
    padding: 40px 60px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
}

/* ===== Page Container ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 60px;
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 16px;
}

/* ===== Profile Page ===== */
.profile-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.profile-form {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.form-actions {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7c75e8 100%);
    color: white;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card h3 {
    margin-bottom: 5px;
}

.profile-card p {
    opacity: 0.8;
    font-size: 14px;
}

.profile-links {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-light);
}

.profile-link:last-child {
    border-bottom: none;
}

.profile-link:hover {
    background: #f9f9ff;
    opacity: 1;
}

.profile-link .link-icon {
    font-size: 20px;
}

.profile-link span:nth-child(2) {
    flex: 1;
    font-weight: 500;
}

.profile-link .link-arrow {
    color: var(--primary);
}

/* ===== Form Styling for profile ===== */
.profile-form .input-wrapper input,
.profile-form .input-wrapper select,
.profile-form .input-wrapper textarea {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-form .input-wrapper textarea {
    min-height: 100px;
    resize: vertical;
}

@media (max-width: 900px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .page-container {
        padding: 30px 20px;
    }
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer a {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== Messages / Alerts ===== */
.messages {
    padding: 0 60px;
    margin-top: 20px;
}

.message {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 14px;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.message-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ===== Option Items (for onboarding) ===== */
.option-item {
    background: var(--primary-light);
    border-radius: 11px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.option-item:hover {
    background: rgba(80, 73, 211, 0.4);
    transform: translateX(3px);
}

.option-text {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

/* ===== Success Icon ===== */
.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c75e8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 50px;
    height: 50px;
    stroke: white;
    stroke-width: 3;
    fill: none;
}

/* ===== Code Input (for verification) ===== */
.code-inputs {
    display: flex;
    gap: 9px;
    justify-content: center;
    margin-bottom: 40px;
}

.code-input {
    width: 63px;
    height: 64px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.code-input:focus {
    border-color: var(--text-primary);
    border-width: 2px;
}

/* ===== Responsive ===== */

/* Mobile menu button (hidden on desktop) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .hero {
        padding: 0 20px;
        height: 250px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .recipe-content {
        flex-direction: column;
    }
    
    .recipe-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        padding: 15px 20px;
        gap: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-light);
        margin-top: 15px;
    }

    .header-collapse.open {
        display: flex;
    }

    .header-nav {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .header-nav a {
        display: block;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 15px;
    }

    .header-nav a:hover {
        background: rgba(80, 73, 211, 0.07);
    }

    .header-buttons {
        flex-wrap: wrap;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid var(--border-light);
    }

    .header-buttons .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .auth-container {
        padding: 60px 20px;
        border-radius: 30px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 15px;
    }
    
    .auth-logo {
        width: 140px;
        height: 140px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .messages {
        padding: 0 20px;
    }
    
    .footer {
        padding: 30px 20px;
    }
    
    .recipe-grid-large {
        grid-template-columns: 1fr;
    }
    
    .code-input {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .recipe-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 26px;
    }
    
    h2 {
        font-size: 22px;
    }
}

/* ===== Recipe Detail Page ===== */
.recipe-header {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 40px;
}

.recipe-header-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.back-link {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
}

.recipe-header h1 {
    margin-bottom: 20px;
}

.recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recipe-hero-image {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.recipe-hero-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.recipe-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c75e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}

.allergen-warning {
    background: #fee2e2;
    border: 2px solid #fca5a5;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.allergen-warning h3 {
    color: #dc2626;
    margin-bottom: 10px;
}

.allergen-warning ul {
    margin: 10px 0;
    padding-left: 20px;
}

.recipe-content {
    display: flex;
    gap: 40px;
}

.recipe-main {
    flex: 1;
}

.recipe-sidebar {
    width: 350px;
    flex-shrink: 0;
}

.recipe-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.recipe-info-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.info-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-card.highlight {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.info-icon {
    font-size: 24px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
}

.info-card.highlight .info-label {
    color: rgba(255,255,255,0.8);
}

.info-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

.nutrition-card {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.nutrition-card h4 {
    margin-bottom: 15px;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.nutrition-item {
    text-align: center;
}

.nutrition-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #16a34a;
    display: block;
}

.nutrition-label {
    font-size: 12px;
    color: var(--text-muted);
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.recipe-section {
    margin-bottom: 40px;
}

.recipe-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.step-item::before {
    counter-increment: step;
    content: counter(step);
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.step-time {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.step-image {
    max-width: 200px;
    border-radius: var(--radius-sm);
}

/* Ingredients Card */
.ingredients-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 25px;
    position: sticky;
    top: 100px;
}

.ingredients-card h3 {
    margin-bottom: 20px;
}

.servings-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.servings-control input {
    width: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
}

.ingredients-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredient-name {
    font-weight: 500;
    flex: 1;
    min-width: 120px;
    word-break: break-word;
}

.ingredient-amount {
    color: var(--primary);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.ingredient-notes {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

/* Reviews */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-author .author-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.review-rating {
    font-weight: 600;
}

.review-text {
    margin-bottom: 10px;
    line-height: 1.6;
}

.review-image {
    max-width: 200px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.review-date {
    color: var(--text-muted);
}

.review-form-card {
    background: #f9f9ff;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-top: 20px;
}

.review-form-card h3 {
    margin-bottom: 20px;
}

.review-note {
    color: var(--text-muted);
    font-style: italic;
}

.no-reviews {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
}

/* Recipe List Page */
.search-filters-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 30px;
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 150px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.tags-details {
    margin-top: 15px;
}

.tags-details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--primary);
}

.tags-list {
    margin-top: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fafbff 0%, #f5f6ff 100%);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid #e8e9ff;
}

.tags-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: contents;
}

.tags-list li {
    display: contents;
}

/* Стили для label внутри ul > li (стандартный виджет Django) */
.tags-list ul label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid #e0e3ff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
    color: #5049d3;
    box-shadow: 0 2px 4px rgba(80, 73, 211, 0.08);
    user-select: none;
}

.tags-list ul label:hover {
    border-color: #5049d3;
    background: linear-gradient(135deg, #f0f1ff 0%, #e8e9ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(80, 73, 211, 0.15);
}

.tags-list ul input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tags-list ul label:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #5049d3 0%, #6c63ff 100%);
    border-color: #5049d3;
    color: white;
    box-shadow: 0 4px 12px rgba(80, 73, 211, 0.3);
}

.tags-list ul label:has(input[type="checkbox"]:checked):hover {
    background: linear-gradient(135deg, #4039c3 0%, #5c53ef 100%);
    transform: translateY(-1px);
}

/* Tag chips - красивые овальные кнопки */
.tags-chips {
    margin-top: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fafbff 0%, #f5f6ff 100%);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid #e8e9ff;
}

.tag-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e3ff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6c63ff;
    box-shadow: 0 2px 8px rgba(80, 73, 211, 0.08);
    user-select: none;
}

.tag-chip-btn:hover {
    border-color: #6c63ff;
    background: #f8f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(80, 73, 211, 0.15);
}

.tag-chip-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Активний стан тега */
.tag-chip-btn.active,
.tag-chip-btn:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #6c63ff 0%, #5049d3 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(80, 73, 211, 0.35);
}

.tag-chip-btn.active:hover,
.tag-chip-btn:has(input[type="checkbox"]:checked):hover {
    background: linear-gradient(135deg, #5c53ef 0%, #4039c3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(80, 73, 211, 0.4);
}

.tag-chip-text {
    pointer-events: none;
}

/* Tag chips для страницы рецептов */
.tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f1ff 100%);
    border: 2px solid #e0e3ff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
    color: #5049d3;
    box-shadow: 0 2px 4px rgba(80, 73, 211, 0.08);
    user-select: none;
}

.tag-chip:hover {
    border-color: #5049d3;
    background: linear-gradient(135deg, #f0f1ff 0%, #e8e9ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(80, 73, 211, 0.15);
}

.tag-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tag-chip.selected,
.tag-chip:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #5049d3 0%, #6c63ff 100%);
    border-color: #5049d3;
    color: white;
    box-shadow: 0 4px 12px rgba(80, 73, 211, 0.3);
}

.tag-chip.selected:hover,
.tag-chip:has(input[type="checkbox"]:checked):hover {
    background: linear-gradient(135deg, #4039c3 0%, #5c53ef 100%);
    transform: translateY(-1px);
}

.recipe-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.recipe-tag {
    background: var(--primary-light);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.recipe-time {
    font-size: 12px;
    color: var(--text-muted);
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 10px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Button Danger */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s;
}

.menu-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(80, 73, 211, 0.1);
}

.menu-card-header {
    margin-bottom: 15px;
}

.menu-card-header h3 {
    margin-bottom: 5px;
}

.menu-card-header h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.menu-card-header h3 a:hover {
    color: var(--primary);
}

.menu-date {
    font-size: 14px;
    color: var(--text-muted);
}

.menu-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Shopping List styling */
.shopping-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.shopping-list-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s;
}

.shopping-list-card:hover {
    border-color: var(--primary);
}

.shopping-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.shopping-list-header h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.shopping-list-header h3 a:hover {
    color: var(--primary);
}

.shopping-list-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Tips styling */
.tips-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tip-card-large {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 25px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.tip-card-large:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tip-card-large .tip-category {
    margin-bottom: 10px;
}

.tip-card-large .tip-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.tip-card-large .tip-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Form styling improvements */
.form-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.form-card h2 {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

/* Category Tags */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.category-tags .tag {
    cursor: pointer;
    transition: all 0.2s;
}

.category-tags .tag:hover,
.category-tags .tag.active {
    background: var(--primary);
    color: white;
}

/* Tip Article */
.tip-article {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 40px;
}

.tip-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-light);
}

.tip-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tip-header h1 {
    margin-bottom: 15px;
}

.tip-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tip-hero-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.tip-hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

.tip-content {
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
}

.tip-content p {
    margin-bottom: 20px;
}

.tip-image {
    aspect-ratio: 16 / 10;
    margin-bottom: 15px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.related-section {
    margin-top: 40px;
}

.related-section h2 {
    margin-bottom: 20px;
}

/* Search Form Card */
.search-form-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 30px;
    max-width: 700px;
}

.search-form-card .input-wrapper textarea,
.search-form-card .input-wrapper input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    resize: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkbox-group {
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Search Results */
.results-section {
    margin-top: 30px;
}

.results-section h2 {
    margin-bottom: 20px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.search-result-card {
    display: flex;
    gap: 15px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 15px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-result-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c75e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.result-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.stat-match {
    color: #16a34a;
    font-weight: 600;
}

.stat-missing {
    color: #f59e0b;
}

.stat-missing.complete {
    color: #16a34a;
}

/* Formset Table */
.formset-table {
    margin-top: 20px;
}

.formset-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr 60px;
    gap: 10px;
    padding: 10px 15px;
    background: #f9f9ff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.formset-table.steps .formset-header {
    grid-template-columns: 60px 3fr 1fr 80px 60px;
}

.formset-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr 60px;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.formset-table.steps .formset-row {
    grid-template-columns: 60px 3fr 1fr 80px 60px;
}

.formset-cell input,
.formset-cell select,
.formset-cell textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
}

.formset-cell textarea {
    min-height: 60px;
    resize: vertical;
}

.formset-cell input[type="checkbox"] {
    width: auto;
}

/* Recipe Edit Form */
.recipe-edit-form .form-card {
    margin-bottom: 30px;
    max-width: none;
}

.recipe-edit-form .form-card h2 {
    font-size: 20px;
}

.recipe-edit-form .input-wrapper input,
.recipe-edit-form .input-wrapper select,
.recipe-edit-form .input-wrapper textarea {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipe-edit-form .input-wrapper textarea {
    min-height: 80px;
    resize: vertical;
}

@media (max-width: 900px) {
    .recipe-header {
        grid-template-columns: 1fr;
    }
    
    .recipe-hero-image {
        height: 200px;
    }
}

/* ===== Star Ratings ===== */
.stars-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rating-text {
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

.review-stars {
    display: flex;
    gap: 2px;
}

.star.filled path {
    fill: #ffc107;
}

.star.empty path {
    fill: #ddd;
}

/* ===== Global Mobile Fixes ===== */
@media (max-width: 768px) {
    /* Recipe grid */
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .recipe-grid-large {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Recipe detail two-column */
    .recipe-content {
        flex-direction: column;
    }
    
    .recipe-sidebar {
        width: 100%;
    }
    
    .recipe-header {
        grid-template-columns: 1fr;
    }
    
    .recipe-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Formset tables scroll */
    .formset-header,
    .formset-row {
        grid-template-columns: 2fr 1fr 1fr auto 40px !important;
        font-size: 12px;
        gap: 6px;
        padding: 10px;
    }
    
    .formset-table.steps .formset-header,
    .formset-table.steps .formset-row {
        grid-template-columns: 40px 2fr 1fr 60px 40px !important;
    }
    
    /* Page container padding */
    .page-container {
        padding: 20px 15px;
    }
    
    /* Payment page */
    .payment-layout {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .payment-container {
        padding: 0 15px;
        margin: 30px auto;
    }
    
    /* Subscription plans */
    .pricing-cards {
        grid-template-columns: 1fr !important;
    }
    
    .subscription-container {
        margin: 30px auto;
    }
    
    .subscription-header h1 {
        font-size: 24px;
    }
    
    /* Search bar */
    .search-bar {
        padding: 10px 15px;
    }
    
    /* Filter chips */
    .filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    /* Footer */
    .footer-content {
        padding: 0 10px;
    }
    
    .footer-content p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .recipe-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .recipe-name {
        font-size: 13px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .recipe-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .auth-container {
        padding: 40px 16px;
    }

    .form-control {
        padding: 14px 12px;
        font-size: 14px;
    }

    .input-wrapper {
        padding: 14px 12px;
        gap: 8px;
    }

    .input-wrapper input {
        font-size: 14px;
    }

    .form-card {
        padding: 20px 16px;
    }

    .formset-cell input,
    .formset-cell select,
    .formset-cell textarea {
        padding: 8px 6px;
        font-size: 12px;
    }
}

/* ===== Tablet (768px–1100px) ===== */
@media (min-width: 768px) and (max-width: 1100px) {
    .header {
        padding: 15px 25px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-nav {
        gap: 12px;
    }

    .header-nav a {
        font-size: 13px;
    }

    .header-buttons .btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    .hero {
        padding: 0 30px;
        height: 280px;
    }

    h1 {
        font-size: 30px;
    }

    .page-container {
        padding: 30px 25px;
    }

    .recipe-grid-large {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .recipe-header {
        grid-template-columns: 1fr 300px;
        gap: 25px;
    }

    .recipe-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .recipe-content {
        gap: 25px;
    }

    .recipe-sidebar {
        width: 280px;
    }

    .main-content {
        padding: 25px 25px;
        gap: 30px;
    }

    .sidebar {
        width: 240px;
    }

    .filters-row {
        flex-wrap: wrap;
    }

    .filter-item {
        min-width: 130px;
    }

    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .messages {
        padding: 0 25px;
    }

    .footer {
        padding: 30px 25px;
    }

    .formset-header,
    .formset-row {
        gap: 8px;
        padding: 10px;
        font-size: 13px;
    }

    .nutrition-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Profile two-column layout collapses on tablet */
    .profile-layout,
    .profile-content,
    .settings-grid,
    .stats-row {
        grid-template-columns: 1fr !important;
    }

    .profile-sidebar {
        position: static;
    }

    /* Smart search filters stack above results */
    .smart-search-container .search-layout,
    .search-layout {
        grid-template-columns: 1fr !important;
    }

    .filters-panel {
        position: static !important;
    }

    /* Analytics — two columns of charts */
    .charts-section {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Pricing / subscription cards stack to two columns */
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Payment page */
    .payment-layout {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Pantry & search results grids */
    .pantry-grid,
    .results-grid,
    .search-results-grid,
    .recipe-grid-large {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Generic page width */
    main, .page-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tables / wide blocks scroll instead of overflow */
    table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }
}
