/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg-rose: #fff7fb;
    --bg-soft: #fff0f6;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: #fff9fc;
    --line: #f0bfd1;
    --line-strong: #e791b0;
    --text: #46253a;
    --muted: #7d5a6d;
    --accent: #d94f8b;
    --accent-deep: #b1346d;
    --accent-soft: #ffe0ec;
    --shadow: 0 18px 40px rgba(186, 75, 125, 0.14);
}

body {
    margin: 0;
    font-family: "DM Sans", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 205, 223, 0.8), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 222, 234, 0.8), transparent 24%),
        linear-gradient(180deg, #fff9fc 0%, #fff3f8 48%, #fff8fb 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* === Header === */
.site-header {
    background: rgba(255, 248, 252, 0.9);
    border-bottom: 1px solid rgba(231, 145, 176, 0.45);
    backdrop-filter: blur(12px);
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brand {
    color: var(--accent-deep);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: auto;
    text-transform: uppercase;
}

.header-inner nav a,
.account-links a {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-left: 1rem;
    text-transform: uppercase;
}

.header-inner nav a:hover,
.account-links a:hover { color: var(--accent-deep); }

/* === Main Content === */
.main-content {
    max-width: 980px;
    margin: 3.5rem auto 4.5rem;
    padding: 0 1.25rem;
}

h1, h2, h3 {
    color: var(--text);
    font-family: "Fraunces", Georgia, serif;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: 0.12em;
    line-height: 0.95;
    margin-bottom: 0.75rem;
    margin-top: 0;
    text-transform: uppercase;
}

h2 {
    font-size: 1.45rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

p {
    margin-top: 0;
}

/* === Recipe Grid (cards) === */
.recipe-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.recipe-card {
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.recipe-card:hover {
    box-shadow: 0 22px 44px rgba(186, 75, 125, 0.2);
    transform: translateY(-4px);
}

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

.card-body {
    padding: 1.35rem 1.35rem 1.5rem;
    flex: 1;
}

.card-body h2 {
    font-size: 1.35rem;
    line-height: 1.05;
    margin: 0 0 0.55rem;
}

.card-body p  {
    color: var(--muted);
    font-size: 0.98rem;
    margin: 0 0 0.9rem;
}

.rating-summary {
    color: var(--accent-deep);
    font-size: 0.92rem;
    font-weight: bold;
    margin: 0 0 0.7rem;
}

.rating-summary-detail {
    margin-top: 0.45rem;
}

.category-pill {
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent-deep);
    display: inline-block;
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    margin: 0 0 0.75rem;
    padding: 0.34rem 0.8rem;
    text-transform: uppercase;
}

.category-pill-detail {
    margin-bottom: 0.45rem;
}

/* === Tags === */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

.tag {
    background: #fff9fc;
    border: 1px solid rgba(231, 145, 176, 0.35);
    color: var(--muted);
    font-size: 0.78rem;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
}

/* === Search === */
.search-block {
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    padding: 1.1rem;
}

.search-block form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
}

.search-block label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 100%;
}

.search-block input[type="search"] {
    background: #fffdfd;
    border: 1px solid rgba(231, 145, 176, 0.42);
    border-radius: 14px;
    color: var(--text);
    font-size: 1rem;
    flex: 1;
    min-width: 180px;
    padding: 0.8rem 1rem;
}

.browse-controls {
    align-items: stretch;
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.85);
    border-radius: 26px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1.15rem 1.25rem;
}

.toolbar-group {
    display: flex;
    flex: 1 1 340px;
    flex-direction: column;
    gap: 0.7rem;
}

.toolbar-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0;
    text-transform: uppercase;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.category-tab {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(231, 145, 176, 0.45);
    border-radius: 999px;
    color: var(--muted);
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.6rem 1rem;
}

.category-tab:hover {
    text-decoration: none;
}

.category-tab-active {
    background: linear-gradient(135deg, #f06ea3 0%, #cf4d88 100%);
    border-color: #cf4d88;
    color: #fff;
}

button, input[type="submit"] {
    background: linear-gradient(135deg, #f06ea3 0%, #cf4d88 100%);
    box-shadow: 0 10px 22px rgba(191, 70, 121, 0.18);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover, input[type="submit"]:hover {
    box-shadow: 0 14px 26px rgba(191, 70, 121, 0.24);
    transform: translateY(-1px);
}

/* === Profile === */
.profile-intro {
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.82);
    border-radius: 26px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1.8rem;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    flex-wrap: wrap;
}
.profile-intro img {
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 24px rgba(186, 75, 125, 0.15);
    height: 120px;
    object-fit: cover;
    width: 120px;
    border-radius: 50%;
}

/* === Recipe Detail === */
.recipe-detail {
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.82);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 1.8rem;
}

.recipe-detail img {
    border-radius: 22px;
    margin: 1.4rem 0;
    max-height: 350px;
    object-fit: cover;
    width: 100%;
}

.recipe-meta {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-soft);
    border: 1px solid rgba(231, 145, 176, 0.28);
    padding: 1rem 1.15rem;
    border-radius: 20px;
    margin: 1.3rem 0;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.recipe-author {
    color: var(--muted);
    margin-top: 0.35rem;
}

.rating-panel {
    background: linear-gradient(180deg, #fffafc 0%, #fff1f7 100%);
    border: 1px solid rgba(231, 145, 176, 0.35);
    border-radius: 24px;
    margin: 1.4rem 0;
    padding: 1.2rem;
}

.rating-panel h2 {
    margin-top: 0;
}

.rating-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.star-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.star-choice {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(231, 145, 176, 0.35);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.star-choice:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.star-choice.is-active {
    background: var(--accent-soft);
    border-color: var(--accent-deep);
}

.star-input {
    left: -9999px;
    position: absolute;
}

.star-visual {
    color: #f5a8c6;
    font-size: 1.15rem;
    line-height: 1;
}

.star-choice.is-active .star-visual {
    color: var(--accent-deep);
}

.star-label {
    color: var(--text);
    font-size: 0.95rem;
}

.rating-submit {
    display: none;
}

.helper-text {
    color: var(--muted);
    margin-bottom: 0;
}

.recipe-columns {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.recipe-columns > section {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(240, 191, 209, 0.65);
    border-radius: 22px;
    flex: 1;
    min-width: 200px;
    padding: 1.2rem 1.25rem;
}
.recipe-columns ul, .recipe-columns ol { padding-left: 1.25rem; }
.recipe-columns li { margin-bottom: 0.55rem; }

/* === Login === */
.login-form {
    background: var(--panel);
    border: 1px solid rgba(240, 191, 209, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    max-width: 420px;
    padding: 1.4rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}
.form-group input {
    background: #fffdfd;
    border: 1px solid rgba(231, 145, 176, 0.42);
    border-radius: 14px;
    color: var(--text);
    width: 100%;
    padding: 0.8rem 0.9rem;
    font-size: 1rem;
}
.error-msg { color: var(--accent-deep); font-weight: bold; }

/* === Responsive === */
@media (max-width: 600px) {
    .header-inner { gap: 0.5rem; }
    .brand { font-size: 1.35rem; }
    .main-content { margin-top: 2.3rem; }
    .browse-controls { align-items: stretch; padding: 1rem; }
    .recipe-card { flex: 1 1 100%; }
    .recipe-detail { padding: 1.2rem; }
    .recipe-columns { flex-direction: column; }
    .recipe-meta { flex-direction: column; gap: 0.5rem; }
}
