@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Cores principais (Nova Paleta TapMesa) */
    --color-primary: #c7ab70;
    --color-primary-hover: #b5995e;
    --color-secondary: #c4ac92;

    /* Tons Neutros */
    --color-background: #f2eee7;
    --color-text: #262626;
    --color-muted: #9d8277;
    --color-border: #c4ac92;
    --color-disabled-bg: #e6e0d6;
    --color-disabled-text: #9d8277;
    --color-success: #c7ab70;
    --color-danger: #dc2626;

    /* Fontes */
    --font-display: "Cormorant Garamond", serif;
    --font-body: "Inter", sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

.app {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background-color: var(--color-background);
    transition: background-color 0.3s ease;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.5rem;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1;

    /* Hide scrollbars for premium look */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.screen::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.hidden {
    display: none !important;
}

/* Cabeçalho da Marca */
.brand {
    text-align: center;
    margin-top: clamp(1rem, 3.5svh, 2.25rem);
    margin-bottom: clamp(1rem, 3svh, 1.75rem);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text);
    margin-bottom: 1.25rem;
}

.logo-text {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
}

.part-tap {
    color: var(--color-text);
    transition: color 0.3s ease;
}

.part-mesa {
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.brand-logo-img {
    max-height: 24px;
    width: auto;
    object-fit: contain;
    filter: none;
    transition: filter 0.3s ease;
}

.restaurant-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text);
    transition: color 0.3s ease;
}

/* Informação da Mesa */
.table-info {
    text-align: center;
    margin-bottom: 0.75rem;
}

.table-number {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

/* Mensagens e Status */
.greeting-container,
.status-container {
    text-align: center;
    margin-bottom: clamp(1.25rem, 3.5svh, 2.25rem);
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-muted);
    font-weight: 400;
}

.status-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.status-message {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-muted);
    line-height: 1.5;
}

/* Tela de Confirmação */
.confirmation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    text-align: center;
    width: 100%;
}

.status-icon {
    color: var(--color-success);
    margin-top: clamp(1rem, 4svh, 2.5rem);
    margin-bottom: 1rem;
    animation: scaleIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.status-icon svg {
    width: 72px;
    height: 72px;
}

/* Campo de Observação */
.note-container {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 1.5rem auto;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.note-label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-muted);
    text-align: left;
}

.note-input-wrapper {
    position: relative;
    width: 100%;
}

.note-input {
    width: 100%;
    height: 44px;
    padding: 0 4rem 0 0.85rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.02);
}

.note-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(199, 171, 112, 0.15);
}

body.dark .note-input:focus {
    box-shadow: 0 0 0 3px rgba(199, 171, 112, 0.15);
}

.char-counter {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-muted);
    font-weight: 500;
    pointer-events: none;
}

/* Botões */
.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 360px;
    margin: 0 auto clamp(1rem, 3.5svh, 2.5rem) auto;
}

.btn {
    width: 100%;
    height: 52px;
    padding: 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: inherit;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;

    transition:
        transform 0.2s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}


/* =========================================
   BOTÃO PRINCIPAL
   ========================================= */

.btn-primary {
    background: var(--color-primary, #c7ab70);
    color: #ffffff;

    box-shadow: 0 2px 6px rgba(199, 171, 112, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover, #b5995e);
    filter: brightness(0.95);

    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.35);
}

.btn-primary:active:not(:disabled) {
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2);
}


/* =========================================
   BOTÃO SECUNDÁRIO
   ========================================= */

.btn-secondary {
    background: #f7f7f4;
    color: var(--color-text);

    box-shadow:
        -6px -6px 12px rgba(255, 255, 255, 0.95),
        8px 9px 18px rgba(0, 0, 0, 0.10),
        2px 3px 6px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: #f7f7f4;

    box-shadow:
        -7px -7px 14px rgba(255, 255, 255, 0.95),
        9px 10px 20px rgba(0, 0, 0, 0.11),
        2px 3px 7px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active:not(:disabled) {
    box-shadow:
        inset -3px -3px 7px rgba(255, 255, 255, 0.95),
        inset 4px 4px 8px rgba(0, 0, 0, 0.08);
}


/* =========================================
   DESABILITADO
   ========================================= */

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}


/* =========================================
   BOTÃO VOLTAR
   ========================================= */

.btn-back {
    margin-top: 1.5rem;
    width: auto;
    min-width: 220px;
    height: 48px;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.actions-hint {
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
    font-weight: 400;
}

/* Animações */
@keyframes scaleIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {

    .screen,
    .btn,
    .status-icon {
        transition: none !important;
        animation: none !important;
    }
}

/* Botão do Alternador de Tema */
.theme-toggle-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 100;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

body.dark .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Alternar ícones do Sol/Lua conforme tema */
body.dark .sun-icon {
    display: block;
    color: var(--color-primary);
}

body.dark .moon-icon {
    display: none;
}

body:not(.dark) .sun-icon {
    display: none;
}

body:not(.dark) .moon-icon {
    display: block;
    color: var(--color-primary);
}

/* Modo Escuro (Dark Mode) */
body.dark {
    --color-background: #18181b;
    --color-text: #f4f4f5;
    --color-muted: #a1a1aa;
    --color-disabled-bg: #27272a;
    --color-disabled-text: #52525b;
    --color-primary: #c7ab70;
}

body.dark .btn-secondary {
    background: #202023;
    /* Diferença sutil de luminosidade para não sumir no fundo */
    box-shadow:
        -6px -6px 14px rgba(255, 255, 255, 0.04),
        8px 9px 18px rgba(0, 0, 0, 0.50),
        2px 3px 6px rgba(0, 0, 0, 0.25);
}

body.dark .btn-secondary:hover:not(:disabled) {
    background: #202023;
    box-shadow:
        -7px -7px 16px rgba(255, 255, 255, 0.05),
        9px 10px 20px rgba(0, 0, 0, 0.55),
        2px 3px 7px rgba(0, 0, 0, 0.27);
}

body.dark .btn-secondary:active:not(:disabled) {
    box-shadow:
        inset -3px -3px 7px rgba(255, 255, 255, 0.04),
        inset 4px 4px 8px rgba(0, 0, 0, 0.45);
}

body.dark .btn-primary {
    background: var(--color-primary, #c7ab70) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(199, 171, 112, 0.25);
}

body.dark .btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover, #b5995e) !important;
    filter: brightness(0.95);
    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.35);
}

body.dark .btn-primary:active:not(:disabled) {
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark .btn-back {
    color: #ffffff;
    border-color: #ffffff;
}

.brand-logo-img.logo-dark {
    display: none;
}

body.dark .brand-logo-img.logo-light {
    display: none !important;
}

body.dark .brand-logo-img.logo-dark {
    display: block !important;
    filter: none;
}

body.dark .part-tap {
    color: #ffffff;
}

body.dark .part-mesa {
    color: #22c55e;
    /* Verde brilhante e legível no Modo Escuro */
}