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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f5f5f0;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar {
    background: #2d6a4f;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

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

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.nav-links a:hover {
    color: white;
}

.nav-user {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.btn-link:hover {
    color: white;
}

.inline {
    display: inline;
}

main {
    padding: 2rem 1rem;
}

h1 {
    margin-bottom: 1.5rem;
    color: #2d6a4f;
}

h2 {
    margin-bottom: 0.75rem;
    color: #2d6a4f;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.recipe-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.recipe-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.recipe-card h2 a {
    color: #1a1a1a;
    text-decoration: none;
}

.recipe-card h2 a:hover {
    color: #2d6a4f;
}

.description {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.meta {
    color: #888;
    font-size: 0.85rem;
}

.card-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge.public {
    background: #d4edda;
    color: #155724;
}

.badge.private {
    background: #f8d7da;
    color: #721c24;
}

.btn {
    display: inline-block;
    background: #2d6a4f;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #245a42;
}

.btn-small {
    display: inline-block;
    background: #e9ecef;
    color: #333;
    border: none;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-small:hover {
    background: #dee2e6;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0;
}

.auth-form,
.recipe-form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="number"] {
    width: 5rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
}

.form-footer {
    margin-top: 1rem;
    text-align: center;
    color: #555;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.recipe-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recipe-detail section {
    margin-top: 1.5rem;
}

.servings-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.servings-control label {
    font-weight: 600;
    color: #333;
}

.servings-control input[type="number"] {
    width: 3.5rem;
    text-align: center;
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.servings-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f5f5f0;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.servings-btn:hover {
    background: #e9ecef;
}

.servings-base {
    color: #888;
    font-size: 0.85rem;
}

.recipe-text {
    white-space: pre-wrap;
    line-height: 1.8;
}

.recipe-actions {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 3rem 0;
}

@media (max-width: 600px) {
    .nav-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
