/*
 * meu-agendamento.css — Consulta/cancelamento de agendamento
 * Design: Ocean Dark (tokens landing-v3). UI/UX Pro Max — WCAG AA.
 */

:root {
    --bg:#0a0e1a; --card:#111827; --border:#1f2937;
    --input-bg:#1c2333; --purple:#667eea; --purple2:#764ba2;
    --text:#e5e7eb; --muted:#8892ab;
    --safe-top:env(safe-area-inset-top,0px);
    --nav-total:calc(var(--safe-top));
}

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

/* ── UX #9: Reduced motion ── */
@media(prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

body{
    background:linear-gradient(135deg,#0a0e27 0%,#1a1f3a 100%);
    min-height:100vh;
    font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    color:var(--text);
    font-size:16px;
}

/* ── UX #28: Focus visible ── */
:focus-visible{outline:2px solid var(--purple);outline-offset:3px;border-radius:4px}

/* ── UX #22: Touch target mínimo 44px ── */
button,a.btn,input[type=submit]{min-height:44px;min-width:44px}

::selection{background:rgba(102,126,234,.35);color:#fff}

/* ── Wrapper principal ─────────────────────────────────────────────── */
.page-wrapper {
    max-width: 680px;
    margin: 0 auto;
    /* Padding inferior: 96px base + safe-area para não sobrepor FAB bar */
    padding: 24px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.logo-area { text-align: center; margin-bottom: 16px; }
.logo-area .icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.logo-area h1 { font-size: 22px; font-weight: 700; color: #fff; margin: 6px 0 2px; }
.logo-area p  { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 16px;
}
.form-card h2 {
    font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px;
    display: flex; align-items: center; gap: 8px;
}
.form-card h2 i { color: var(--purple); }
.subtitle { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ── Formulário ─────────────────────────────────────────────────────── */
.form-label {
    display: block; font-size: 13px; font-weight: 600; color: var(--muted);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px;
}
.form-control {
    width: 100%; background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 16px;
    outline: none; transition: border-color .2s;
}
.form-control:focus { border-color: var(--purple); }
.form-control::placeholder { color: #4b5563; }

/* ── Input de data — fix iOS overflow e placeholder cross-platform ─── */
/*
 * iOS Safari não respeita max-width em input[type="date"] sem min-width:0;
 * overflow:hidden no wrapper impede que o seletor nativo extrapole a borda do card.
 */
.date-wrap { position: relative; width: 100%; overflow: hidden; }
.date-wrap .bi-calendar3 {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: #4b5563; font-size: 16px; line-height: 1;
}
.date-ph {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #4b5563; font-size: 16px; pointer-events: none; line-height: 1;
}
input[type="date"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; max-width: 100%; min-width: 0;
    box-sizing: border-box; padding-right: 40px;
}
/* Esconde o "dd/mm/aaaa" nativo do Chrome quando o campo está vazio e sem foco */
input[type="date"]:not(:focus):invalid::-webkit-datetime-edit-text,
input[type="date"]:not(:focus):invalid::-webkit-datetime-edit-month-field,
input[type="date"]:not(:focus):invalid::-webkit-datetime-edit-day-field,
input[type="date"]:not(:focus):invalid::-webkit-datetime-edit-year-field { color: transparent; }
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
/* Oculta o span placeholder quando focado ou com valor (controlado via JS com classe .has-val) */
.date-wrap input:focus ~ .date-ph,
.date-wrap input.has-val ~ .date-ph { display: none; }

.mb-3 { margin-bottom: 16px; }

/* ── Botões ─────────────────────────────────────────────────────────── */
.btn-primary-grad {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px 20px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    text-decoration: none; transition: opacity .2s, transform .15s;
}
.btn-primary-grad:hover { opacity: .9; transform: translateY(-1px); }

.btn-outline-back {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px 20px; border: 1px solid var(--border);
    border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; background: transparent;
    transition: border-color .2s, color .2s; margin-top: 10px;
}
.btn-outline-back:hover { border-color: var(--purple); color: var(--text); }

/* Botão de cancelamento — destrutivo, cor vermelha para sinalizar ação irreversível */
.btn-cancel {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 20px; border: 1px solid rgba(248,113,113,.35);
    border-radius: 12px; color: #f87171; font-size: 15px; font-weight: 700;
    background: rgba(248,113,113,.06); cursor: pointer;
    transition: background .2s, border-color .2s; margin-top: 8px;
}
.btn-cancel:hover { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.55); }

/* ── Mensagens flash pós-redirect (PRG pattern) ─────────────────────── */
.flash-ok, .flash-err {
    border-radius: 10px; padding: 12px 16px; font-size: 14px;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.flash-ok  { background: rgba(74,222,128,.1);  border: 1px solid rgba(74,222,128,.3);  color: #86efac; }
.flash-err { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: #fca5a5; }

/* ── Badge de status ────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px; border-radius: 100px; font-size: 14px; font-weight: 700;
}

/* ── Linhas de detalhe do agendamento ───────────────────────────────── */
.detail-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-icon  { color: var(--purple); font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.detail-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }
.detail-value { font-weight: 600; color: var(--text); }

/* ── Caixa de política de cancelamento ──────────────────────────────── */
.policy-box {
    background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.25);
    border-radius: 12px; padding: 14px 16px; font-size: 13px; color: #fde68a;
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px;
}
.policy-box i { flex-shrink: 0; margin-top: 1px; font-size: 15px; }

/* ── Bloco de pagamento PIX ─────────────────────────────────────────── */
.pmt-card {
    background: rgba(251,191,36,.04); border: 1px solid rgba(251,191,36,.18);
    border-radius: 14px; padding: 20px; text-align: center;
}
.pmt-valor   { font-size: 32px; font-weight: 800; color: #fde68a; margin: 10px 0 4px; }
.pmt-methods { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.btn-pix {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 20px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #00c853, #1b5e20);
    color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
    transition: opacity .2s;
}
.btn-pix:hover     { opacity: .88; }
.btn-pix:disabled  { opacity: .55; cursor: not-allowed; }

.btn-card {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px 20px; border: 1px solid rgba(102,126,234,.3);
    border-radius: 12px; background: rgba(102,126,234,.07);
    color: #c7d2fe; font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background .2s;
}
.btn-card:hover { background: rgba(102,126,234,.15); }

/* ── Área do QR Code PIX ─────────────────────────────────────────────── */
#pixArea { display: none; margin-top: 16px; }
.pix-qr-wrap img { border-radius: 12px; border: 2px solid var(--border); max-width: 200px; width: 100%; }
.pix-copy-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 12px; padding: 11px;
    border: 1px solid rgba(74,222,128,.3); border-radius: 10px;
    background: rgba(74,222,128,.07); color: #86efac;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.pix-status { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ── Cards de intenção de pagamento (turista) ──────────────────────────── */
.pagto-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
    user-select: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.pagto-card:hover { border-color: rgba(102,126,234,.4); background: rgba(102,126,234,.04); }
.pagto-card.pagto-selected {
    border-color: #667eea !important;
    background: rgba(102,126,234,.1) !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,.2);
}
.pagto-radio-indicator {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #374151; background: var(--input-bg); margin-top: 3px; transition: all .2s;
}
.pagto-card.pagto-selected .pagto-radio-indicator {
    border-color: #667eea; background: #667eea;
    box-shadow: inset 0 0 0 3px var(--card);
}
.pagto-card-label { font-weight: 700; font-size: 14px; color: #e2e8f0; margin-bottom: 2px; }
.pagto-card-desc  { font-size: 12px; color: var(--muted); line-height: 1.45; }
.pagto-card.pagto-selected .pagto-card-label { color: #c4b5fd; }

@media (max-width: 430px) {
    .pagto-card       { padding: 12px 12px; gap: 10px; }
    .pagto-card-label { font-size: 13px; }
    .pagto-card-desc  { font-size: 11px; }
}

/* ── Estado de erro (link inválido/expirado) ─────────────────────────── */
.error-icon { font-size: 52px; color: #f87171; display: block; text-align: center; margin-bottom: 12px; }

/* ── Link sutil (rodapé dos cards) ──────────────────────────────────── */
.link-muted { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.link-muted a { color: var(--purple); text-decoration: none; }
.link-muted a:hover { text-decoration: underline; }

/* ── Banner de política de ausência (modo busca) ─────────────────────── */
/*
 * O banner usa position:relative + overflow:hidden para conter o pseudo-elemento ::before
 * (gradiente radial) sem vazar para fora do card.
 */
.policy-banner {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #1a1200 0%, #2a1f00 55%, #1a1200 100%);
    border: 1px solid rgba(251,191,36,.28);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 14px;
    animation: fadeUp .35s ease forwards;
}
.policy-banner::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 15% 50%, rgba(251,191,36,.10) 0%, transparent 65%);
    pointer-events: none;
}
.policy-banner-icon  { font-size: 30px; flex-shrink: 0; line-height: 1; }
.policy-banner-body  { flex: 1; min-width: 0; }
.policy-banner-title { font-size: 14px; font-weight: 700; color: #fde68a; margin-bottom: 3px; }
.policy-banner-desc  { font-size: 13px; color: #b8943a; line-height: 1.5; }
.policy-banner-badge {
    flex-shrink: 0;
    background: rgba(251,191,36,.12);
    border: 1px solid rgba(251,191,36,.30);
    border-radius: 100px;
    padding: 5px 13px;
    font-size: 12px; font-weight: 700; color: #fbbf24;
    text-align: center; white-space: nowrap;
}

/* ── Animação de entrada ─────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsivo mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .page-wrapper { padding: 16px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
    .form-card    { padding: 20px 16px; }
    .policy-banner { padding: 14px 16px; gap: 10px; }
    /* Badge oculto em telas muito pequenas para economizar espaço vertical */
    .policy-banner-badge { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   CHECKLIST — passos até a aula (independentes, não-sequenciais)
   ═══════════════════════════════════════════════════════════════════════ */
.checklist-strip {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: 14px 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.cl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 64px;
    max-width: 90px;
    text-align: center;
}

.cl-dot {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: background .3s, border-color .3s, color .3s, box-shadow .3s;
}

/* Pendente */
.cl-pending .cl-dot {
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.12);
    color: var(--muted);
}
.cl-pending .cl-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.cl-pending .cl-sub   { font-size: 10px; color: var(--muted); }

/* Ativo (próximo passo) */
.cl-active .cl-dot {
    background: rgba(102,126,234,.18);
    border: 2px solid var(--purple);
    color: var(--purple-light);
    box-shadow: 0 0 14px rgba(102,126,234,.35);
}
.cl-active .cl-label { font-size: 11px; color: var(--purple-light); font-weight: 700; }
.cl-active .cl-sub   { font-size: 10px; color: var(--purple-light); font-weight: 600; }

/* Concluído */
.cl-done .cl-dot {
    background: rgba(16,185,129,.15);
    border: 1.5px solid rgba(16,185,129,.45);
    color: #10b981;
}
.cl-done .cl-label { font-size: 11px; color: #6ee7b7; font-weight: 500; }
.cl-done .cl-sub   { font-size: 10px; color: #34d399; }

/* Interrompido */
.checklist-interrupted .cl-interrupted .cl-dot {
    background: rgba(239,68,68,.12);
    border-color: rgba(239,68,68,.35);
    color: #f87171;
}
.checklist-interrupted .cl-interrupted .cl-label { color: #fca5a5; }

@media (max-width: 400px) {
    .checklist-strip { gap: 8px; padding: 10px 2px; }
    .cl-step { min-width: 50px; }
    .cl-dot { width: 32px; height: 32px; font-size: 14px; }
    .cl-label { font-size: 10px; }
}

/* ── iPhone Pro Max (430px) — tipografia fluida ───────────────────────── */
@media (max-width: 430px) {
    .logo-area h1, h1 { font-size: clamp(18px, 6vw, 22px); }
}
