:root {
    --gold: #c9a84c;
    --gold-light: #e8c872;
    --gold-dark: #a8872e;
    --black: #0a0a0a;
    --black-soft: #141414;
    --cream: #faf8f4;
    --cream-dark: #f0ebe0;
    --bg-gradient: linear-gradient(145deg, #0a0a0a 0%, #1a1510 45%, #0d0d0d 100%);
    --primary: #c9a84c;
    --primary-hover: #b8943f;
    --card-bg: rgba(250, 248, 244, 0.97);
    --card-border: rgba(201, 168, 76, 0.35);
    --text-main: #1a1a1a;
    --text-muted: #6b6358;
    --success: #8b7340;
}

* {
    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;
}

.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(90px);
    opacity: 0.22;
    animation: float 10s infinite ease-in-out alternate;
}
.blob-1 {
    width: 320px;
    height: 320px;
    background: #c9a84c;
    top: -120px;
    left: -80px;
}
.blob-2 {
    width: 420px;
    height: 420px;
    background: #8b6914;
    bottom: -120px;
    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 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 168, 76, 0.08);
    transition: all 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}
.logo-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 0 auto 16px;
    max-width: 320px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
#brand-logo {
    width: 100%;
    height: auto;
    display: block;
}
.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: 0.04em;
}
.header p {
    color: var(--text-muted);
    font-size: 14px;
}

.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;
    color: var(--text-main);
}

.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: #fff;
    border: 1px solid #ddd5c5;
    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 3px rgba(201, 168, 76, 0.18);
}
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: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    color: #1a1208;
    border: 1px solid rgba(168, 135, 46, 0.5);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #edd88a 0%, var(--gold-light) 50%, var(--gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -10px rgba(201, 168, 76, 0.55);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-dark);
}
.btn-secondary:hover {
    background: rgba(201, 168, 76, 0.08);
}
.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(--gold-dark);
}

.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: #fff;
    border: 1px solid #ddd5c5;
    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(201, 168, 76, 0.07);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(201, 168, 76, 0.2);
}
.h-data { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.h-hora { font-size: 18px; font-weight: 700; color: var(--gold-dark); display: block; }
.h-medico { font-size: 11px; color: var(--text-main); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4c4a0; border-radius: 10px; }

.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}
.loading.hidden { display: none; }
.hidden { display: none !important; }
.simulado-aviso {
    margin: 12px 0 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f5edd8;
    color: #7a5c1a;
    border: 1px solid rgba(201, 168, 76, 0.35);
    font-size: 13px;
    font-weight: 600;
}
.spinner {
    width: 30px; height: 30px;
    border: 3px solid #ede4d0;
    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-selecionado-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.35);
    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; }

.success-box {
    text-align: center;
    padding: 20px 0;
}
.icon-success {
    width: 60px; height: 60px;
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px auto;
    border: 2px solid var(--gold);
}
.success-box h2 { color: var(--gold-dark); margin-bottom: 10px; }
.success-box p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.protocolo-box {
    background: var(--cream);
    border: 1px solid rgba(201, 168, 76, 0.3);
    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(--gold-dark); }
