
:root {
    --background: #afadb1;
    --surface: #ffffff;
    --dark: #171717;
    --text: #202020;
    --muted: #656565;
    --radius: 22px;
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 45px 30px;
    flex: 1;
}

h1 {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

h3 {
    font-size: 19px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 12px;
}

button, input, select, textarea {
    font: inherit;
    transition: all 0.2s ease;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #656565;
    outline-offset: 3px;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

img {
    max-width: 100%;
    display: block;
}

/* Переключение экранов */

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: appear 0.4s ease;
}

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

/* Верхнее меню */

#navigation {
    padding: 20px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    border-bottom: 1px solid #999999;
}

.logo {
    background: transparent;
    border: none;
    color: var(--dark);
    font-size: 26px;
    font-weight: 750;
    letter-spacing: 3px;
}

#navigation nav {
    display: flex;
    gap: 6px;
    background: var(--dark);
    padding: 6px;
    border-radius: 16px;
}

#navigation nav button {
    background: transparent;
    border: none;
    color: white;
    padding: 13px 22px;
    border-radius: 11px;
    font-size: 14px;
}

#navigation nav button:hover,
#navigation nav button.active {
    background: white;
    color: black;
}

/* Карточки */

.panel {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.fact-card {
    background: var(--dark);
    color: white;
    border-radius: 17px;
    padding: 24px;
    font-size: 15px;
}

.subtitle {
    text-align: center;
    color: #424242;
    margin-bottom: 30px;
}

.small-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 15px;
}

.brand {
    font-size: clamp(42px, 8vw, 76px);
    letter-spacing: 7px;
    text-align: center;
    margin-bottom: 5px;
}

/* Кнопки */

.primary-button {
    background: var(--dark);
    color: white;
    border: 1px solid var(--dark);
    border-radius: 13px;
    padding: 15px 26px;
    font-weight: 600;
    margin-top: 18px;
}

.primary-button:hover:not(:disabled) {
    background: #333333;
    transform: translateY(-2px);
}

.secondary-button {
    background: transparent;
    color: var(--dark);
    border: 1px solid var(--dark);
    border-radius: 13px;
    padding: 12px 22px;
    margin-top: 18px;
}

.secondary-button:hover:not(:disabled) {
    background: var(--dark);
    color: white;
}

/* Поля ввода */

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
}

input, select, textarea {
    width: 100%;
    background: #f3f3f3;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 14px;
    color: var(--text);
    margin-bottom: 18px;
}

input:focus, select:focus, textarea:focus {
    border-color: #777777;
    background: white;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    accent-color: var(--dark);
}

/* Регистрация */

#registration {
    padding-top: 35px;
}

.registration-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    align-items: center;
    gap: 28px;
    margin-top: 45px;
}

.registration-layout .panel {
    padding: 38px;
    margin: 0;
}

.registration-layout h2 {
    text-align: center;
}

.registration-layout .primary-button {
    width: 100%;
}

.registration-layout .fact-card:first-child {
    transform: translateY(-35px);
}

.registration-layout .fact-card:last-child {
    transform: translateY(35px);
}

/* Анкета */

.questionnaire {
    max-width: 850px;
    margin: 25px auto;
    padding: 40px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.questionnaire h3 {
    border-top: 1px solid #dddddd;
    padding-top: 20px;
    margin-top: 20px;
}

.questionnaire .primary-button {
    width: 100%;
}

/* Теги */

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0 22px;
}

.tag,
.tag-option,
.tag-group button {
    background: #eeeeee;
    border: 1px solid #dddddd;
    color: var(--dark);
    border-radius: 30px;
    padding: 10px 17px;
    font-size: 14px;
}

.tag-group button:hover {
    border-color: black;
}

.tag-option.selected,
.tag-group button.selected,
.tag-group button[aria-pressed="true"] {
    background: var(--dark);
    color: white;
}

/* Главная страница */

.hero {
    padding: 65px 25px;
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(38px, 6vw, 70px);
}

.hero h2 {
    font-weight: 500;
}

.hero p {
    max-width: 680px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: 700;
    color: #424242;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.feature-grid span {
    display: block;
    font-size: 35px;
    color: #888888;
}

/* Выбор вкуса и консистенции */

#taste, #texture {
    max-width: 950px;
    margin: auto;
    text-align: center;
}

.step {
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
}

.progress-track {
    background: #d5d3d6;
    height: 5px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 35px;
}

.progress-half {
    background: black;
    height: 100%;
    width: 50%;
}

.progress-full {
    background: black;
    height: 100%;
    width: 100%;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 760px;
    margin: 35px auto;
}

.choice-card {
    background: #d1cfd2;
    border: 2px solid black;
    border-radius: 24px;
    padding: 30px;
    min-height: 215px;
    text-align: center;
}

.choice-card:hover {
    background: black;
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.choice-card h2 {
    margin: 12px 0 7px;
}

.choice-card p {
    font-size: 14px;
}

.emoji {
    display: block;
    font-size: 46px;
}

.centered-card {
    grid-column: 1 / -1;
    width: 55%;
    justify-self: center;
}

#taste .fact-card,
#texture .fact-card {
    max-width: 450px;
    margin: 25px auto;
    text-align: left;
}

/* Карточки рецептов */

#results h1 {
    text-align: center;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin: 30px 0;
}

.recipe-card {
    background: white;
    border-radius: 23px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s;
}

.recipe-card:hover {
    transform: translateY(-5px);
}

.recipe-card img {
    width: 100%;
    height: 270px;
    object-fit: cover;
}

.recipe-card-body {
    padding: 25px;
}

.recipe-card .primary-button {
    width: 100%;
}

.recipe-meta {
    color: var(--muted);
    font-size: 14px;
}

#show-more,
#results > .primary-button {
    display: block;
    margin: 25px auto;
}

/* Подробный рецепт */

#recipe-details {
    max-width: 900px;
    margin: auto;
}

.recipe-details {
    margin-top: 25px;
}

#detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 25px;
}

#detail-ingredients label {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eeeeee;
    padding: 12px 0;
    font-weight: 400;
}

#detail-ingredients input:checked + span {
    text-decoration: line-through;
    color: #777777;
}

#detail-steps {
    padding-left: 28px;
}

#detail-steps li {
    padding: 15px 10px;
    border-bottom: 1px solid #eeeeee;
}

#like-recipe {
    width: 100%;
}

/* Профиль */

#profile {
    max-width: 900px;
    margin: auto;
}

#profile h1 {
    text-align: center;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 35px;
}

.avatar {
    width: 140px;
    height: 140px;
    border-radius: 30px;
    background: #eeeeee;
    object-fit: cover;
}

#profile-login {
    font-size: 30px;
    overflow-wrap: anywhere;
}

#profile-name,
#profile-info {
    color: var(--muted);
}

.stat-item {
    margin: 16px 0;
}

.stat-bar {
    height: 8px;
    background: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: black;
    border-radius: 10px;
}

/* История рецептов */

#history {
    max-width: 950px;
    margin: auto;
}

#history h1 {
    text-align: center;
}

#history .fact-card {
    margin: 25px 0;
}

#history-search {
    background: white;
    padding: 17px;
}

.history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    background: white;
    padding: 22px;
    border-radius: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.history-card img {
    width: 140px;
    height: 110px;
    object-fit: cover;
    border-radius: 13px;
}

.history-date {
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    background: white;
    border-radius: 22px;
    padding: 45px 25px;
    text-align: center;
    color: var(--muted);
}

/* Нижняя часть сайта */

footer {
    padding: 25px;
    border-top: 1px solid #999999;
    text-align: center;
    font-size: 12px;
    color: #454545;
}

/* Адаптация под телефоны и планшеты */

@media (max-width: 900px) {

    #navigation {
        flex-direction: column;
    }

    .registration-layout {
        grid-template-columns: 1fr;
    }

    .registration-layout .fact-card {
        transform: none !important;
    }

    .registration-layout .panel {
        grid-row: 1;
    }
}

@media (max-width: 600px) {

    main {
        padding: 25px 16px;
    }

    #navigation nav {
        width: 100%;
    }

    #navigation nav button {
        flex: 1;
        font-size: 11px;
        padding: 12px 6px;
    }

    .form-grid,
    .feature-grid,
    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .panel, .questionnaire {
        padding: 22px;
    }

    .choice-grid {
        gap: 12px;
    }

    .choice-card {
        padding: 18px 10px;
        min-height: 165px;
    }

    .choice-card h2 {
        font-size: 18px;
    }

    .emoji {
        font-size: 35px;
    }

    .centered-card {
        width: 70%;
    }

    .hero {
        padding: 30px 5px;
    }

    .recipe-card img {
        height: 230px;
    }

    #detail-image {
        height: 250px;
    }

    .profile-header {
        gap: 20px;
    }

    .avatar {
        width: 90px;
        height: 90px;
    }

    #profile-login {
        font-size: 21px;
    }

    .history-card {
        gap: 12px;
        padding: 15px;
    }

    .history-card img {
        width: 90px;
        height: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================
   АРТИШОК 2.0
   Компактный интерфейс
   ========================================= */


/* Верхнее меню */

#navigation nav {
    flex-wrap: wrap;
    justify-content: center;
}

#navigation nav button {
    padding: 10px 16px;
}


/* =========================================
   Компактный профиль
   ========================================= */

#profile {
    max-width: 720px;
    margin: 0 auto;
    font-size: 14px;
}

#profile h1 {
    font-size: 30px;
    margin-bottom: 15px;
}

#profile h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

#profile h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

#profile .panel,
#profile .profile-card {
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 15px;
}

#profile p {
    margin-bottom: 5px;
}

#profile .profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

#profile .avatar {
    width: 85px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 18px;
}

#profile-login {
    font-size: 23px !important;
}

#profile-name,
#profile-info {
    font-size: 13px;
}

#profile .tag-group {
    gap: 5px;
    margin: 6px 0;
}

#profile .tag {
    padding: 4px 10px;
    font-size: 12px;
}

#profile button {
    font-size: 13px;
}

#profile .primary-button,
#profile .secondary-button {
    padding: 10px 15px;
    margin-top: 6px;
    border-radius: 10px;
}


/* Статистика вкусов */

#profile-statistics {
    font-size: 13px;
}

#profile .stat-item {
    margin: 7px 0;
}

#profile .stat-bar {
    height: 6px;
    margin-top: 4px;
}

#avatar-selector {
    padding: 12px;
}

#avatar-selector img {
    width: 50px !important;
    height: 50px !important;
}


/* =========================================
   История и избранное
   ========================================= */

#history,
#favorites {
    max-width: 760px;
    margin: 0 auto;
    font-size: 14px;
}

#history h1,
#favorites h1 {
    font-size: 30px;
    margin-bottom: 15px;
    text-align: center;
}

#history .fact-card,
#favorites .fact-card {
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    border-radius: 12px;
}

#history-search {
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
}

#history-list,
#favorites-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

#favorites-count {
    font-size: 13px;
    margin: 12px 0;
}


/* Компактные карточки */

.compact-recipe-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 16px;
    gap: 15px;
    border-radius: 14px;
    color: #171717;
}

.compact-recipe-info {
    flex: 1;
    min-width: 0;
}

.compact-recipe-card h3 {
    font-size: 17px;
    line-height: 1.3;
    margin: 4px 0;
}

.compact-recipe-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    cursor: pointer;
}

.compact-recipe-tags {
    font-size: 12px;
    color: #666666;
    margin: 4px 0;
}

.compact-recipe-date {
    font-size: 11px;
    color: #777777;
    margin: 0;
}

.compact-open-button {
    background: #171717;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 11px;
    margin-top: 5px;
    font-size: 12px;
    cursor: pointer;
}

.compact-remove-button {
    background: transparent;
    color: #b52e38;
    border: none;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}

#clear-history {
    padding: 9px 15px;
    font-size: 13px;
    margin-top: 12px;
}

#history .empty-state,
#favorites .empty-state {
    background: #ffffff;
    padding: 25px 15px;
    text-align: center;
    border-radius: 14px;
}

#favorites > .primary-button {
    display: block;
    margin: 20px auto;
}


/* =========================================
   Компактный профиль на компьютере
   ========================================= */

@media (min-width: 700px) {

    #profile.active:not([hidden]) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #profile > h1,
    #profile > .profile-header,
    #profile > #avatar-selector,
    #profile > #profile-favorites,
    #profile > .profile-card,
    #profile > :has(#profile-statistics) {
        grid-column: 1 / -1;
    }

    #profile .panel {
        margin-bottom: 0;
    }
}


/* =========================================
   Мобильная версия
   ========================================= */

@media (max-width: 600px) {

    #navigation nav {
        flex-wrap: wrap;
        width: 100%;
    }

    #navigation nav button {
        flex: 1 1 45%;
        font-size: 12px;
        padding: 10px 6px;
    }

    #profile h1,
    #history h1,
    #favorites h1 {
        font-size: 25px;
    }

    #profile .panel {
        padding: 13px;
    }

    #profile .avatar {
        width: 65px;
        height: 65px;
    }

    .compact-recipe-card {
        padding: 10px;
        gap: 10px;
    }

    .compact-recipe-card img {
        width: 65px;
        height: 65px;
    }

    .compact-recipe-card h3 {
        font-size: 14px;
    }
}

/* =========================================
   Компактные карточки подбора рецептов
   ========================================= */

#results {
    max-width: 1100px;
    margin: 0 auto;
}

#results h1 {
    font-size: 30px;
    margin-bottom: 12px;
}

#selected-tags {
    font-size: 15px;
    margin-bottom: 12px;
}

#result-count {
    font-size: 13px;
    margin-bottom: 14px;
}


/* Сетка рецептов */

#recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}


/* Карточка рецепта */

#results .recipe-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    min-width: 0;
}


/* Изображение блюда */

#results .recipe-card img {
    width: 100%;
    height: 145px;
    object-fit: cover;
}


/* Содержимое карточки */

#results .recipe-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
    gap: 8px;
}


/* Название блюда */

#results .recipe-card h2,
#results .recipe-card h3 {
    font-size: 18px;
    line-height: 1.35;
    margin: 0 0 6px;
}


/* Описание блюда */

#results .recipe-card p {
    font-size: 13px;
    line-height: 1.4;
    margin: 4px 0;
}

#results .recipe-description,
#results .recipe-card-body > p:first-of-type {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Время приготовления */

#results .recipe-time {
    font-size: 12px;
    margin: 4px 0;
}


/* Теги вкуса и консистенции */

#results .tag-group {
    gap: 5px;
    margin: 5px 0 8px;
}

#results .tag {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 20px;
}


/* Кнопка открытия рецепта */

#results .recipe-card button {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    min-height: 38px;
    border-radius: 9px;
}

#results .recipe-card-body > button:last-child {
    margin-top: auto;
}


/* Кнопка показа дополнительных рецептов */

#show-more {
    padding: 10px 22px;
    font-size: 14px;
    margin-top: 20px;
    border-radius: 10px;
}


/* Планшеты и небольшие мониторы */

@media (max-width: 950px) {

    #recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

}


/* Телефоны */

@media (max-width: 550px) {

    #recipe-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #results .recipe-card img {
        height: 130px;
    }

    #results .recipe-card h2,
    #results .recipe-card h3 {
        font-size: 16px;
    }

    #results .recipe-card-body {
        padding: 12px;
    }

    #results h1 {
        font-size: 25px;
    }

}

/* Полное описание блюда без обрезания */

#results .recipe-description,
#results .recipe-card-body > p:first-of-type {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    white-space: normal;
    font-size: 13px;
    line-height: 1.45;
    margin: 6px 0;
}
