/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E VARIÁVEIS
   ========================================================================== */
:root {
    --primary: #C5A059;
    /* Dourado Viegas */
    --primary-dark: #8a6d32;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #888888;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding-bottom: 90px;
    overflow-x: hidden;
}

/* Utilitários */
.container {
    padding: 25px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   2. ANIMAÇÃO DE PASSOS (DIVULGAÇÃO PROGRESSIVA)
   ========================================================================== */
.step-container {
    animation: slideDown 0.5s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   3. LANDING PAGE
   ========================================================================== */
.landing-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1585747860715-2ba37e788b70?q=80&w=2074&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, #0f0f0f 100%);
}

.landing-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    animation: fadeInUp 0.8s ease;
}

.hero-logo h1 {
    font-size: 3.5rem;
    letter-spacing: 8px;
    background: -webkit-linear-gradient(#fff, #C5A059);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-logo p {
    letter-spacing: 5px;
    color: var(--primary);
    margin-top: -5px;
    margin-bottom: 30px;
    font-size: 0.8rem;
}

.hero-slogan {
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #fff;
}

.text-gold {
    color: var(--primary);
    font-weight: 800;
    font-style: italic;
}

.btn-hero {
    background: var(--primary);
    color: #000;
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.4);
    transition: transform 0.2s;
    width: 100%;
    max-width: 300px;
}

.btn-hero:hover {
    transform: scale(1.05);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. CABEÇALHO E UI
   ========================================================================== */
header {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.logo-area h1 {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: var(--text-light);
}

.logo-area p {
    color: var(--primary);
    font-size: 0.6rem;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.header-welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.welcome-text h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.welcome-text p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0;
}

.btn-mini-logout {
    background: transparent;
    border: 1px solid #d9534f;
    color: #d9534f;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s;
}

.btn-mini-logout:hover {
    background: #d9534f;
    color: white;
}

.section-title {
    display: block;
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.input-group {
    margin-bottom: 20px;
}

input,
select {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    background: #222;
}

/* ==========================================================================
   5. CARDS DE PROFISSIONAIS E GRADE
   ========================================================================== */
.barber-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #2a2a2a;
    cursor: pointer;
    transition: 0.3s;
}

.card.selected {
    border-color: var(--primary);
    background: #221e15;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.15);
}

.card img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #333;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    padding: 5px 0;
}

.slot-btn {
    background: #2a2a2a;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 0;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.slot-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.slot-btn.selected {
    background: var(--primary);
    color: #000;
    font-weight: 800;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
    transform: scale(1.05);
}

.slot-btn.ocupado {
    background: #151515;
    color: #444;
    border-color: transparent;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}

@media (max-width: 480px) {
    .slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   6. SELEÇÃO DE SERVIÇOS
   ========================================================================== */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.service-item {
    background: #2a2a2a;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.service-item:hover {
    border-color: #666;
}

.service-item.selected {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--primary);
}

.service-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.service-item span {
    color: var(--primary);
    font-weight: bold;
}

.total-bar {
    background: #111;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed #444;
    margin-bottom: 15px;
}

.total-bar strong {
    color: var(--primary);
    font-size: 1.4rem;
}

/* ==========================================================================
   7. BOTÕES E COMPONENTES GERAIS
   ========================================================================== */
.btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
    margin-top: 10px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn.danger {
    border-color: #d9534f;
    color: #d9534f;
}

.btn.small {
    padding: 8px 20px;
    font-size: 0.8rem;
    width: auto;
}

.btn.text-only {
    background: transparent;
    color: #888;
    box-shadow: none;
    padding: 10px;
}

/* ==========================================================================
   8. MODAL, MENU E TOAST
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    border: 1px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 15px;
    border-radius: 50px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    transition: 0.3s;
}

.nav-item span {
    font-size: 1.4rem;
    display: block;
}

.nav-item.active {
    color: var(--primary);
    transform: translateY(-3px);
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1a1a1a;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease forwards;
}

.toast.error {
    border-left-color: #d9534f;
}

/* QR CODE E CAIXA 'EM DESENVOLVIMENTO' */
#qrcode-container img {
    margin: 0 auto;
    display: block;
}

.dev-box {
    margin-top: 20px;
    padding: 10px;
    border: 1px dashed var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-weight: bold;
    letter-spacing: 2px;
}

/* ==========================================================================
   CORREÇÃO DO BOTÃO FECHAR (X)
   ========================================================================== */

/* Importante: Adiciona posição relativa para o botão "obedecer" a janela */
.modal-content {
    position: relative;
}

.btn-close {
    position: absolute;
    /* Faz o botão flutuar */
    top: 10px;
    right: 15px;
    background: transparent;
    /* Remove o fundo branco/cinza */
    border: none;
    /* Remove a borda padrão */
    color: #fff;
    /* Cor do X */
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.btn-close:hover {
    color: var(--primary);
    /* Fica dourado ao passar o mouse */
    transform: scale(1.1);
}