:root {
    --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e2e8f0 100%);
    --primary: #00C1B4;
    --primary-hover: #00998f;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 1);
    --text-main: #002D44; /* Azul marinho da Avance */
    --text-muted: #64748b;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Glassmorphism Background Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out alternate;
}
.blob-1 {
    width: 300px;
    height: 300px;
    background: #00C1B4;
    top: -100px;
    left: -100px;
}
.blob-2 {
    width: 400px;
    height: 400px;
    background: #005a8a;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}
.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}
.header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Steps System */
.step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}
.form-row {
    display: flex;
    gap: 15px;
}
.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}
input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 193, 180, 0.2);
}
option {
    background: #ffffff;
    color: var(--text-main);
}

button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}
.btn-back {
    width: auto;
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    font-size: 13px;
    margin-bottom: 20px;
    display: inline-block;
}
.btn-back:hover {
    color: var(--text-main);
}

/* Horarios Grid */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}
.horario-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}
.horario-btn:hover {
    border-color: var(--primary);
    background: rgba(0, 193, 180, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.h-data { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.h-hora { font-size: 18px; font-weight: 700; color: var(--primary); display: block; }
.h-medico { font-size: 11px; color: var(--text-main); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Loading State */
.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}
.loading.hidden { display: none; }
.spinner {
    width: 30px; height: 30px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Horario box na Step 3 */
.horario-selecionado-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 193, 180, 0.1);
    border: 1px solid rgba(0, 193, 180, 0.3);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
}
.horario-selecionado-box .icon { font-size: 24px; }
.horario-selecionado-box p { font-size: 12px; color: var(--text-muted); }
.horario-selecionado-box strong { font-size: 15px; color: var(--text-main); display: block; margin-top: 4px; }

/* Sucesso */
.success-box {
    text-align: center;
    padding: 20px 0;
}
.icon-success {
    width: 60px; height: 60px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px auto;
    border: 2px solid var(--success);
}
.success-box h2 { color: var(--success); margin-bottom: 10px; }
.success-box p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.protocolo-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
}
.protocolo-box span { display: block; font-size: 12px; color: var(--text-muted); }
.protocolo-box strong { display: block; font-size: 20px; margin-top: 5px; font-family: monospace; letter-spacing: 2px; color: var(--primary); }
