/* ===== Design System ===== */
:root {
    --primary: #1A1A2E;
    --secondary: #E94560;
    --accent: #0F3460;
    --light: #FFFFFF;
    --dark: #000000;
    --gray: #6B7280;
    --bg: #0a0a1a;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--light);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== Landing ===== */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary) 100%);
}

.landing-content {
    max-width: 360px;
    width: 100%;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out;
}

.logo-small {
    max-width: 120px;
    margin-bottom: 16px;
}

.landing-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.landing-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* ===== Botão Iniciar ===== */
.btn-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: var(--light);
    background: var(--secondary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    position: relative;
}

.btn-start:hover {
    background: #d6384e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233,69,96,0.3);
}

.btn-start:active {
    transform: scale(0.97);
}

.btn-start.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--light);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--light);
    background: rgba(255,255,255,0.1);
}

/* Loader do botão */
.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== Overlay (camera permission, loading, etc) ===== */
.overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 100;
}

.overlay-content {
    text-align: center;
    padding: 24px;
    max-width: 340px;
}

.overlay-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.overlay-content p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 16px;
    line-height: 1.5;
}

.icon-camera {
    font-size: 48px;
    margin-bottom: 16px;
}

.dica {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 16px;
}

details {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
}

details ol {
    padding-left: 20px;
}

details li {
    margin-bottom: 4px;
}

/* ===== Loading cubes ===== */
.loader-cubes {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 24px;
}

.cube {
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 2px;
    animation: cubeBounce 1.2s ease-in-out infinite;
}

.cube:nth-child(2) { animation-delay: 0.2s; }
.cube:nth-child(3) { animation-delay: 0.4s; }

/* ===== Progress bar ===== */
.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 16px auto 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), #ff6b81);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ===== CTA Overlay (AR) ===== */
.cta-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    animation: slideUp 0.5s ease-out;
}

.cta-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.cta-content {
    position: relative;
    width: 100%;
    padding: 24px 16px 32px;
    text-align: center;
}

.cta-mensagem {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--light);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.cta-btn:active {
    transform: scale(0.98);
}

.cta-whatsapp { border-color: #25D366; }
.cta-whatsapp:hover { background: rgba(37,211,102,0.2); }

.cta-promocoes { border-color: var(--secondary); }
.cta-promocoes:hover { background: rgba(233,69,96,0.2); }

.cta-maps { border-color: #4285F4; }
.cta-maps:hover { background: rgba(66,133,244,0.2); }

.cta-icon { font-size: 20px; }

/* ===== Fallback page ===== */
.fallback-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary) 100%);
}

.fallback-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.fallback-container h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.fallback-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
    line-height: 1.5;
}

.video-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.video-wrapper video {
    width: 100%;
    display: block;
}

.ctas-fallback {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctas-fallback .cta-btn {
    margin-bottom: 0;
}

/* ===== Botão som ===== */
.btn-som {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 60;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
}

/* ===== Admin ===== */
.admin-body {
    background: #f3f4f6;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    color: var(--light);
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar h2 {
    font-size: 18px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: var(--light);
}

.admin-main {
    flex: 1;
    padding: 24px 32px;
    overflow-x: auto;
}

.admin-main h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.admin-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-card h3 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-card .valor {
    font-size: 32px;
    font-weight: 700;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.admin-table th {
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: #f9fafb;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(233,69,96,0.1);
}

.form-group input[type="color"] {
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.btn-primary {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover { background: #d6384e; }

.btn-danger {
    padding: 6px 12px;
    font-size: 12px;
    color: white;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid #d1d5db;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--primary);
}

.login-box {
    background: white;
    padding: 32px;
    border-radius: 16px;
    width: 360px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-box h1 {
    font-size: 20px;
    margin-bottom: 24px;
    text-align: center;
    color: var(--primary);
}

.login-box .form-group {
    margin-bottom: 16px;
}

.login-box .btn-primary {
    width: 100%;
    padding: 12px;
}

.login-logo {
    text-align: center;
    margin-bottom: 16px;
}

.login-logo img {
    max-width: 100px;
}

/* Responsivo admin */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        padding: 12px 0;
    }
    .admin-sidebar a {
        display: inline-block;
        padding: 8px 16px;
    }
    .admin-main {
        padding: 16px;
    }
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Responsivo landing ===== */
@media (max-width: 480px) {
    .landing-title { font-size: 20px; }
    .logo { max-width: 150px; }
    .cta-btn { font-size: 14px; padding: 12px 16px; }
}

/* ===== Animações ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes cubeBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-start:not(.loading) {
    animation: fadeInUp 0.6s ease-out 0.4s both, pulse 2s ease-in-out 1.5s infinite;
}

.landing-footer {
    position: fixed;
    bottom: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

.landing-footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: underline;
}

.landing-footer a:hover {
    color: rgba(255,255,255,0.7);
}
