:root {
    --wine: #7b1f2d;
    --wine-dark: #5f1722;
    --wine-soft: #f5e9ec;
    --gold: #c99b3f;
    --ink: #1f2933;
    --muted: #66717d;
    --line: #e5e8ec;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --success: #198754;
    --danger: #c0392b;
    --blue: #2563eb;
    --shadow-sm: 0 8px 24px rgba(31, 41, 51, 0.08);
    --shadow-lg: 0 20px 50px rgba(31, 41, 51, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--surface-soft);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface-soft);
}

button,
input {
    font: inherit;
}

/* =========================
   PÁGINA PÚBLICA
   ========================= */
.public-menu-page {
    background:
        radial-gradient(circle at top left, rgba(123, 31, 45, 0.08), transparent 34rem),
        linear-gradient(180deg, #fbfbfc 0%, #f4f5f7 100%);
    padding: 30px 18px 54px;
}

.menu-shell {
    width: min(100%, 980px);
    margin: 0 auto;
}

.menu-heading {
    text-align: center;
    margin-bottom: 22px;
}

.menu-eyebrow {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--wine);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.menu-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.15rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.menu-validity {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.menu-validity strong {
    color: var(--ink);
}

.weekly-menu-card {
    background: var(--surface);
    border: 1px solid rgba(31, 41, 51, 0.08);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.weekly-menu-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    padding: 18px;
    background: #eceef1;
    cursor: zoom-in;
    isolation: isolate;
}

.weekly-menu-photo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(74vh, 980px);
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(31, 41, 51, 0.12);
}

.zoom-hint {
    position: absolute;
    right: 28px;
    bottom: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    color: #fff;
    background: rgba(31, 41, 51, 0.82);
    backdrop-filter: blur(8px);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

.weekly-menu-image:hover .zoom-hint {
    transform: translateY(-2px);
    background: rgba(123, 31, 45, 0.92);
}

.weekly-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.weekly-status,
.weekly-rotation-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.weekly-status {
    color: var(--success);
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

.single-menu-missing {
    min-height: 430px;
    width: 100%;
}

.image-missing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: var(--danger);
}

.image-missing i {
    font-size: 2.6rem;
}

.image-missing h2,
.image-missing p {
    margin: 0;
}

.admin-link {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(31, 41, 51, 0.76);
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(31, 41, 51, 0.22);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 20;
}

.admin-link:hover {
    transform: translateY(-2px) rotate(8deg);
    background: var(--wine);
}

/* =========================
   MODAL / ZOOM
   ========================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(9, 13, 18, 0.9);
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: min(96vw, 1320px);
    height: min(94vh, 980px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #10151c;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

.modal-image-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px 20px 14px;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.08s linear;
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.24);
}

.modal-info {
    padding: 8px 18px 4px;
    text-align: center;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
}

.modal-info p {
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px 16px;
}

.modal-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* =========================
   LOGIN ADMIN
   ========================= */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(201, 155, 63, 0.22), transparent 30rem),
        linear-gradient(135deg, var(--wine-dark), var(--wine));
}

.login-container {
    width: min(100%, 420px);
}

.login-box {
    width: 100%;
    padding: 34px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.login-box h2 {
    margin: 0 0 26px;
    text-align: center;
    color: var(--ink);
    font-size: 1.55rem;
}

.login-box h2 i {
    margin-right: 8px;
    color: var(--wine);
}

.login-form .form-group,
.password-form .form-group {
    margin-bottom: 18px;
}

.login-form label,
.password-form label {
    display: block;
    margin-bottom: 8px;
    color: #34404c;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-form input[type="password"],
.password-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6dbe1;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input[type="password"]:focus,
.password-form input[type="password"]:focus {
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(123, 31, 45, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--wine);
    font-weight: 800;
    cursor: pointer;
}

.btn-login:hover {
    background: var(--wine-dark);
}

.back-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--wine);
}

/* =========================
   PANEL ADMIN
   ========================= */
.admin-panel {
    min-height: 100vh;
    padding: 24px 18px 48px;
    background: #f4f6f8;
}

.admin-container {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 18px 22px;
    border: 1px solid rgba(31, 41, 51, 0.07);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.admin-header h1 i {
    margin-right: 8px;
    color: var(--wine);
}

.logout-form {
    margin: 0;
}

.btn-logout {
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--danger);
    font-weight: 700;
    cursor: pointer;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 12px;
    font-weight: 650;
}

.alert.error {
    color: #9f2f25;
    background: #fdecea;
    border: 1px solid #f6c8c3;
}

.alert.success {
    color: #126c42;
    background: #e9f7ef;
    border: 1px solid #c8ead8;
}

.admin-content {
    display: grid;
    gap: 22px;
}

.image-control,
.instructions {
    padding: 24px;
    border: 1px solid rgba(31, 41, 51, 0.07);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.image-control h2,
.instructions h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.2rem;
}

.image-control h2 i,
.instructions h2 i {
    margin-right: 8px;
    color: var(--wine);
}

.description {
    margin: 8px 0 20px;
    color: var(--muted);
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.info-card {
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafbfc;
    text-align: center;
}

.info-card h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.info-card .big-text {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    font-weight: 850;
    line-height: 1.05;
}

.admin-week-box {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--wine-soft);
    color: #5d2831;
}

.admin-week-box p {
    margin: 4px 0;
}

.image-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin: 20px 0 0;
}

.image-option {
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.07);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.image-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.11);
}

.image-option.selected {
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(123, 31, 45, 0.09), 0 10px 24px rgba(31, 41, 51, 0.1);
}

.image-option label {
    display: block;
    cursor: pointer;
}

.image-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.image-preview {
    position: relative;
    aspect-ratio: 1 / 1.4142;
    overflow: hidden;
    background: #eef0f2;
}

.image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.image-info-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(to top, rgba(15, 20, 27, 0.86), rgba(15, 20, 27, 0.08));
    font-weight: 800;
}

.image-info-overlay small {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--success);
    font-size: 0.72rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.btn-primary,
.btn-secondary,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 15px;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary {
    color: #fff;
    background: var(--wine);
}

.btn-primary:hover {
    background: var(--wine-dark);
    transform: translateY(-1px);
}

.btn-secondary,
.link-button {
    color: var(--ink);
    background: #edf0f3;
}

.btn-secondary:hover,
.link-button:hover {
    background: #e2e6ea;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.password-form .form-group {
    margin-bottom: 0;
}

.password-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.instructions-content {
    color: #44515e;
    line-height: 1.65;
}

.instructions-content ol {
    margin: 12px 0 0;
    padding-left: 22px;
}

.instructions-content li + li {
    margin-top: 7px;
}

.instructions-content code {
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--wine);
    background: var(--wine-soft);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .password-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .public-menu-page {
        padding: 20px 10px 40px;
    }

    .menu-heading {
        margin-bottom: 16px;
    }

    .weekly-menu-card {
        border-radius: 16px;
    }

    .weekly-menu-image {
        min-height: 300px;
        padding: 8px;
    }

    .weekly-menu-photo {
        width: 100%;
        max-height: none;
        border-radius: 8px;
        box-shadow: none;
    }

    .zoom-hint {
        right: 16px;
        bottom: 16px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .weekly-menu-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 13px 15px;
    }

    .admin-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .btn-logout {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .image-control,
    .instructions {
        padding: 18px;
    }

    .image-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions > * {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .menu-eyebrow {
        font-size: 0.7rem;
    }

    .menu-validity {
        font-size: 0.9rem;
    }

    .weekly-menu-image {
        min-height: 220px;
    }

    .zoom-hint span {
        display: none;
    }

    .zoom-hint {
        width: 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
    }

    .info-grid,
    .image-options {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 26px 20px;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}
