:root {
    --bg-soft: #f7f4ef;
    --bg-card: #ffffff;
    --bg-card-strong: #fffaf3;
    --primary: #b42332;
    --primary-dark: #861f2b;
    --primary-soft: rgba(180, 35, 50, 0.1);
    --accent: #d9a441;
    --text: #292522;
    --muted: #817972;
    --line: rgba(63, 48, 38, 0.1);
    --success: #25815d;
    --danger: #b42332;
    --shadow-soft: 0 18px 36px rgba(43, 34, 28, 0.08);
    --shadow-card: 0 14px 30px rgba(43, 34, 28, 0.07);
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-soft);
    color: var(--text);
}

* {
    box-sizing: border-box;
}

button, input, textarea, select {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

#app {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Loading & welcome styles are defined in theme.css (single source of truth) */

@keyframes loading-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, p {
    margin: 0;
}

.page-message {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 48px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.page-message h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 12px;
}

.page-message p {
    color: var(--muted);
    font-size: 1.05rem;
}

.home-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(251, 249, 246, 0.92));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    border-radius: 28px;
    padding: clamp(24px, 4vw, 42px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 8px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero-card h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.08;
    max-width: 700px;
    margin-bottom: 14px;
}

.hero-card p {
    color: var(--muted);
    max-width: 620px;
    font-size: 1.08rem;
    line-height: 1.6;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.primary-btn, .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #c94a54);
    color: #fff;
    box-shadow: 0 10px 24px rgba(134, 31, 43, 0.2);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    border: 1px solid var(--line);
}

.primary-btn:hover, .secondary-btn:hover,
.menu-button:hover, .meu-pedido-button:hover,
.btn-adicionar:hover, .qty-btn:hover,
.pix-cancelar:hover {
    transform: translateY(-1px);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 18px;
    box-shadow: var(--shadow-card);
}

.feature-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: var(--primary-soft);
    border-radius: 16px;
    margin-bottom: 14px;
}

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.status-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    padding: clamp(20px, 4vw, 32px);
}

.status-card h3 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin-bottom: 12px;
}

.status-card p {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 10px;
}

.status-card .inline-badge {
    display: inline-flex;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 18px;
}

.status-card.success {
    border-color: rgba(47, 158, 97, 0.25);
}

.status-card.success .inline-badge {
    background: rgba(47, 158, 97, 0.12);
    color: #1a7a4c;
}

.status-card.error {
    border-color: rgba(220, 38, 38, 0.18);
}

.status-card.error .inline-badge {
    background: rgba(220, 38, 38, 0.09);
    color: var(--danger);
}

@media (max-width: 820px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 14px 16px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-subtitle {
        display: none;
    }

    .cta-row {
        flex-direction: column;
    }

    .primary-btn, .secondary-btn {
        width: 100%;
    }
}

/* Coffee app visual language */
.welcome-screen {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    background: #27231f url('../images/background_coffee.jpg') center 42% / cover no-repeat;
}
.welcome-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,16,13,.04) 25%, rgba(13,10,9,.9) 100%); }
.welcome-content { position: relative; z-index: 1; width: min(100%, 640px); padding: clamp(28px, 7vw, 64px) clamp(24px, 6vw, 56px) max(42px, calc(18px + env(safe-area-inset-bottom))); text-align: center; animation: rise-in .7s ease both; }
.welcome-mark, .success-icon { width: 58px; height: 58px; margin: 0 auto 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.18); font-size: 1.65rem; }
.welcome-kicker { margin: 0 0 13px; color: #c8a77e; font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.welcome-content h1 { margin: 0 0 17px; font-size: clamp(2.5rem, 12vw, 4.4rem); letter-spacing: .1em; font-weight: 700; line-height: 1; }
.welcome-copy { margin: 0; color: rgba(255,255,255,.84); line-height: 1.6; }
.welcome-button { width: min(100%, 420px); height: 58px; margin: 31px auto 0; padding: 16px 20px; border: 0; border-radius: 14px; background: #f8eee2; color: #241d19; font-weight: 800; cursor: pointer; box-shadow: 0 7px 22px rgba(0,0,0,.15); }
.welcome-button span { float: right; font-size: 1.2rem; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 360px) { .welcome-content { padding-left: 28px; padding-right: 28px; } }

.welcome-button {
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(134, 31, 43, .25);
}

/* Rodapé com versão */
.app-version {
    position: fixed;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .65rem;
    color: var(--muted);
    opacity: .55;
    pointer-events: none;
    z-index: 1;
}
