/* =========================
   Variáveis e base visual
========================= */
:root {
    /* Base */
    --bg: #f7fafc;
    --bg-2: #fff;

    --brand: #7aba3c;
    --brand-2: #5ea12d;
    --brand-3: #3f7e1f;

    --card: #fff;
    --border: #e4e9f1;
    --text: #1f4f7c;
    --muted: #6c7f94;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(17, 24, 39, .08);
    --preloader-bg: #f1f5f9;

    --grad-1: #0f2f54;
    --grad-2: var(--brand);

    --btn-bg: var(--card);
    --btn-text: var(--text);
    --btn-border: var(--border);
    --btn-ghost-text: var(--text);
    --btn-primary-bg: var(--brand);
    --btn-primary-fg: #fff;

    /* Cores auxiliares padronizadas (para reuso em seções) */
    --ok: #22c55e;
    --ok-2: #16a34a;
    --danger: #ef4444;
    --danger-2: #dc2626;

    /* ===== Mapeamentos de seções (apenas referências ao root principal) ===== */

    /* RECUPERAR SENHA (rs-*) */
    --rs-bg: var(--bg);
    --rs-bg-2: var(--bg-2);

    --rs-brand: var(--brand);
    --rs-brand-2: var(--brand-2);
    --rs-brand-3: var(--brand-3);

    --rs-card: var(--card);
    --rs-border: var(--border);
    --rs-text: var(--text);
    --rs-muted: var(--muted);

    --rs-radius: var(--radius);
    --rs-shadow: var(--shadow);

    /* CONFIRMAÇÃO / CANCELAMENTO (ap-*) */
    --ap-bg: var(--bg);
    --ap-card: var(--card);
    --ap-text: var(--text);
    --ap-muted: var(--muted);
    --ap-border: var(--border);

    --ap-brand: var(--grad-1);
    /* era #0f2f54, já mapeado em --grad-1 */
    --ap-ok: var(--ok);
    --ap-ok-2: var(--ok-2);
    --ap-danger: var(--danger);
    --ap-danger-2: var(--danger-2);

    --ap-radius: var(--radius);
    --ap-shadow: var(--shadow);
}

/* =========================
   Reset / Base tipografia
========================= */
* {
    box-sizing: border-box;
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
    overflow-anchor: none;
}

/* =========================================
   PRELOADER
========================================= */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--preloader-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .35s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: var(--brand);
    animation: spin 1s linear infinite;
}

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

/* =========================================
   LINKS / BOTÕES
========================================= */
a {
    color: var(--brand);
    text-decoration: none;
}

a:not(.btn):hover {
    color: var(--brand-2);
}

.btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: var(--btn-shadow);
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .28);
}

.btn--primary {
    background: var(--btn-primary-bg);
    border-color: transparent;
    color: var(--btn-primary-fg);
}

.btn--primary:hover {
    background: var(--brand-2);
}

.btn--primary:active {
    background: var(--brand-3);
    transform: translateY(0);
}

.btn--shine {
    position: relative;
    overflow: hidden;
}

.btn--shine::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .25), transparent);
    transition: left .4s ease;
}

.btn--shine:hover::after {
    left: 120%;
}

/* =========================
   HOME
========================= */
.home {
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.home__wrap {
    width: 100%;
    max-width: 880px;
    text-align: center;
    background: #fff;
    padding: 36px 28px;
}

.home__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.home__logo img {
    width: 100%;
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.home__title {
    margin: 6px 0 6px;
    font-size: clamp(22px, 3.2vw, 32px);
    color: var(--text);
    font-weight: 700;
}

.home__subtitle {
    margin: 0 0 22px;
    font-size: clamp(14px, 2.2vw, 18px);
    color: var(--muted);
}

/* Social */
.home__social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
}

.btn-circle {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}

.btn-circle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

/* Botão principal */
.btn-pill {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .2px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-pill:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

/* Responsivo (HOME) */
@media (max-width: 520px) {
    .home__wrap {
        padding: 28px 18px;
    }

    .home__logo img {
        max-width: 220px;
    }
}

/*
====================================================
  FOOTER
====================================================
*/
.site-footer {
    padding: 0;
    border-radius: 0px;
}

.site-footer::before {
    display: none;
}

.site-footer .container {
    padding: 0;
    margin: 0 auto;
}

.site-footer .copy {
    width: 100%;
    min-height: 40px;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: .85rem;
    backdrop-filter: none;
    gap: .35rem;
    white-space: nowrap;
}

.copy img {
    height: 1rem;
    width: auto;
    vertical-align: middle;
}

/*
====================================================
  ERROR PAGE
====================================================
*/
.error-hero {
    padding: clamp(56px, 8vw, 96px) 0;
    display: flex;
    justify-content: center;

    opacity: 1 !important;
    transform: translateZ(0) scale(1) !important;
    pointer-events: auto !important;
    z-index: 3 !important;
    visibility: visible !important;
    transition-delay: 0s, 0s, 0s !important;
}

.error-wrap {
    display: grid;
    place-items: center;
}

.error-card {
    width: min(760px, 92vw);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(var(--card-rgb, 15, 26, 51), .16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3.2vw, 28px);
    text-align: center;
}

.error-brand {
    display: grid;
    place-items: center;
    gap: 12px;
    margin-bottom: clamp(10px, 2.4vw, 18px);
}

.error-brand img {
    width: min(220px, 60%);
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .25));
}

.error-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: clamp(12px, 2vw, 18px) 0;
    font-size: clamp(20px, 3.4vw, 28px);
    line-height: 1.2;
    background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-title .ico {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--media-top), transparent);
    color: var(--brand);
    font-size: 18px;
}

.error-copy {
    color: var(--muted);
    font-size: clamp(14px, 2.4vw, 17px);
    margin: 8px 0 0;
}

.error-divider {
    width: 120px;
    height: 1px;
    margin: clamp(12px, 2.4vw, 16px) auto;
    background: linear-gradient(90deg, transparent, var(--divider-soft), transparent);
    box-shadow: 0 0 0 1px var(--divider-glow) inset;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: clamp(12px, 2.4vw, 18px);
}

/*
====================================================
  RECUPERAR SENHA
====================================================
*/
.rs-section {
    display: grid;
    place-items: center;
    padding: 40px 16px;
    background: linear-gradient(180deg, var(--rs-bg), var(--rs-bg-2));
    color: var(--rs-text);
}

.rs-wrap {
    width: 100%;
    max-width: 720px;
    text-align: center;
}

.rs-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.rs-logo img {
    width: 100%;
    max-width: 180px;
    max-height: 150px;
    object-fit: contain;
}

.rs-card {
    background: var(--rs-card);
    border: 1px solid var(--rs-border);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow);
    padding: 28px;
    text-align: left;
}

.rs-field {
    margin-bottom: 18px;
}

.rs-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--rs-text);
}

.rs-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rs-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-size: 14px;
}

.rs-input:focus {
    border-color: var(--rs-brand);
    box-shadow: 0 0 0 3px rgba(122, 186, 60, .18);
}

.rs-pw-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rs-border);
    background: #fff;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.rs-pw-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .10);
    border-color: var(--rs-brand);
}

.rs-actions {
    margin-top: 26px;
}

.rs-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--rs-border);
    background: #fff;
    color: var(--rs-text);
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    font-weight: 700;
}

.rs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
}

.rs-btn--primary {
    background: var(--rs-brand);
    border-color: transparent;
    color: #fff;
}

.rs-btn--primary:hover {
    background: var(--rs-brand-2);
}

.rs-btn--primary:active {
    background: var(--rs-brand-3);
    transform: translateY(0);
}

@media (max-width:520px) {
    .rs-card {
        padding: 22px;
    }

    .rs-logo img {
        max-width: 160px;
    }
}

/*
====================================================
  CONFIRMAÇÃO / CANCELAMENTO DE CONSULTAS
====================================================
*/
.ap-section {
    display: grid;
    place-items: center;
    padding: 40px 16px;
    background: linear-gradient(180deg, var(--ap-bg), #fff);
    color: var(--ap-text);
}

.ap-wrap {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.ap-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.ap-logo img {
    width: 100%;
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.ap-card {
    background: var(--ap-card);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    padding: 28px;
}

.ap-title {
    font-size: clamp(22px, 3.2vw, 32px);
    font-weight: 800;
    margin: 8px 0 8px;
    letter-spacing: .2px;
}

.ap-title--ok {
    color: var(--ap-ok);
}

.ap-title--danger {
    color: var(--ap-danger);
}

.ap-title--brand {
    color: var(--ap-brand);
}

.ap-copy {
    margin: 0 0 10px;
    color: var(--ap-muted);
    font-size: clamp(14px, 2.2vw, 18px);
}

.ap-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ap-btn {
    display: inline-block;
    border: 1px solid var(--ap-border);
    background: #fff;
    color: var(--ap-brand);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.ap-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
}

.ap-btn--ok {
    background: var(--ap-ok);
    color: #fff;
    border-color: transparent;
}

.ap-btn--ok:hover {
    background: var(--ap-ok-2);
}

.ap-btn--danger {
    background: var(--ap-danger);
    color: #fff;
    border-color: transparent;
}

.ap-btn--danger:hover {
    background: var(--ap-danger-2);
}

@media (max-width:520px) {
    .ap-card {
        padding: 22px;
    }

    .ap-logo img {
        max-width: 220px;
    }
}