/* ─────────────────────────────────────────────────────────
   FÁCIL GLASS — Estilos de modais
   ───────────────────────────────────────────────────────── */

/* ── OVERLAY / CARD BASE ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 52, 114, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 80px rgba(15,52,114,0.35);
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 36px 32px; }

/* ── STEPS ── */
.modal-step { display: none; }
.modal-step.active { display: block; }

/* ── TYPOGRAPHY ── */
.modal-title {
  font-size: 22px; font-weight: 900;
  color: var(--blue-dark);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
}

/* ── PLAN SELECTOR ── */
.modal-plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.modal-plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.modal-plan-option:hover { border-color: var(--blue-light); }

.modal-plan-option.selected {
  border-color: var(--blue);
  background: rgba(26,78,159,0.06);
}

.modal-plan-option .plan-info { display: flex; align-items: center; gap: 10px; }

.modal-plan-option .plan-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  flex-shrink: 0;
  position: relative;
}

.modal-plan-option.selected .plan-radio { border-color: var(--blue); }

.modal-plan-option.selected .plan-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--blue);
}

.modal-plan-option .plan-name { font-weight: 800; color: var(--blue-dark); font-size: 15px; }

.modal-plan-option .plan-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--orange-dark);
  background: rgba(244,122,32,0.1);
  padding: 2px 8px;
  border-radius: 50px;
}

.modal-plan-option .plan-price { font-weight: 900; color: var(--blue-dark); font-size: 17px; white-space: nowrap; }
.modal-plan-option .plan-price span { font-size: 12px; font-weight: 600; color: var(--gray-400); }

/* ── FORM ── */
.modal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.modal-form-grid .full { grid-column: 1 / -1; }

.modal-field label {
  display: block;
  font-size: 13px; font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.modal-field:has(input[required]) label::after {
  content: ' *';
  color: #e53935;
  font-weight: 700;
}

.modal-required-note { font-size: 12px; color: var(--gray-500); margin-top: 4px; margin-bottom: 2px; }
.modal-required-note span { color: #e53935; font-weight: 700; }

.modal-field input,
.modal-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-800);
  background: white;
  transition: border-color 0.15s;
}

.modal-field input:focus,
.modal-field select:focus {
  outline: none;
  border-color: var(--blue);
}

/* Campo de senha com botão de mostrar/ocultar */
.input-password-wrap { position: relative; }

/* Espaço à direita para o botão não cobrir o texto digitado */
.input-password-wrap input { padding-right: 46px; }

.input-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.input-password-toggle:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

.input-password-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.cep-input-wrap { position: relative; }

.cep-spinner {
  display: none;
  position: absolute;
  top: 50%; right: 12px;
  width: 16px; height: 16px;
  margin-top: -8px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: cep-spin 0.7s linear infinite;
}

.cep-spinner.show { display: block; }

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

.modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px; font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 18px;
  cursor: pointer;
}

.modal-checkbox input { width: 18px; height: 18px; accent-color: var(--blue); }

.modal-section-label {
  font-size: 13px; font-weight: 800;
  color: var(--blue-dark);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 24px 0 14px;
}

/* ── ACTIONS ── */
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }

.modal-btn-back {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 800; font-size: 15px;
  padding: 16px 24px;
  border-radius: 50px;
  border: none; cursor: pointer;
}

.modal-btn-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: white;
  font-weight: 800; font-size: 16px;
  padding: 16px 24px;
  border-radius: 50px;
  border: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(26,78,159,0.35);
}

.modal-btn-primary:hover    { transform: translateY(-2px); }
.modal-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.modal-btn-pay {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  box-shadow: 0 8px 24px rgba(244,122,32,0.4);
}

/* ── FEEDBACK ── */
.modal-error {
  display: none;
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  font-size: 14px; font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.modal-error.show { display: block; }

.modal-success { text-align: center; padding: 12px 0; }

.modal-success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(26,78,159,0.1);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

/* ── TRIAL MODAL PARTS ── */
.modal-trial-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--gray-400);
  font-size: 13px; font-weight: 600;
}

.modal-trial-divider::before,
.modal-trial-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.btn-trial-modal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 2px solid #43a047;
  color: #1b5e20;
  font-size: 14px; font-weight: 700;
  padding: 13px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(67,160,71,0.15);
}

.btn-trial-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(67,160,71,0.22);
}

.btn-trial-modal svg { color: #43a047; flex-shrink: 0; }

.modal-success-trial { text-align: center; padding: 8px 0; }

.modal-success-trial .modal-success-icon {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 2px solid #43a047;
  color: #2e7d32;
}

.modal-download-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

.btn-download-store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: transform 0.15s;
}

.btn-download-store:hover { transform: translateY(-2px); }
.btn-download-ios     { background: #000; color: #fff; }
.btn-download-android { background: #1a4e9f; color: #fff; }

/* ── LOGIN MODAL ── */
.login-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  background: white;
  cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  font-family: inherit;
}

.login-option-btn:hover { transform: translateY(-2px); }

.login-option-btn.primary { border-color: var(--blue); background: rgba(26,78,159,0.04); }
.login-option-btn.primary:hover { background: rgba(26,78,159,0.09); }
.login-option-btn.secondary { border-color: var(--gray-200); }
.login-option-btn.secondary:hover { border-color: var(--gray-400); background: var(--gray-50); }

.login-option-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-option-icon.blue { background: linear-gradient(135deg, var(--blue), var(--blue-light)); }
.login-option-icon.gray { background: var(--gray-100); }

.login-option-text strong {
  display: block;
  font-size: 15px; font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 2px;
}

.login-option-text span { font-size: 13px; color: var(--gray-600); font-weight: 500; }

.login-code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 28px 0;
}

.login-code-inputs input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 24px; font-weight: 800;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--blue-dark);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.login-code-inputs input:focus { border-color: var(--blue); }

.login-resend { font-size: 13px; color: var(--gray-400); text-align: center; margin-top: 8px; }

.login-resend button {
  background: none; border: none;
  color: var(--blue); font-weight: 700;
  cursor: pointer; font-size: 13px;
  padding: 0; font-family: inherit;
}

.login-resend button:disabled { color: var(--gray-400); cursor: not-allowed; }

/* ── PROFILE MODAL ── */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: white;
  font-size: 28px; font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.profile-name  { font-size: 22px; font-weight: 900; color: var(--blue-dark); text-align: center; letter-spacing: -0.5px; margin-bottom: 4px; }
.profile-email { font-size: 14px; color: var(--gray-600); text-align: center; margin-bottom: 28px; }

.profile-info-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-info-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.profile-info-label { font-size: 12px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.6px; }
.profile-info-value { font-size: 14px; font-weight: 600; color: var(--gray-800); text-align: right; }

.btn-logout {
  width: 100%;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 50px;
  border: 2px solid #fecaca;
  background: #fff5f5;
  color: #dc2626;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

/* ── PROFILE SUBSCRIPTION STATUS ── */
.profile-sub-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 600;
}

.profile-sub-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: cep-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.profile-sub-active {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(34,197,94,0.07);
  border: 1.5px solid rgba(34,197,94,0.35);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

/* CTA de assinatura durante o período de teste */
.profile-trial-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.profile-trial-cta-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-600);
  text-align: center;
}

.profile-sub-active-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(34,197,94,0.12);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-sub-active-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-sub-active-label {
  font-size: 13px;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-sub-active-detail {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.profile-sub-expired-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(220,38,38,0.06);
  border: 1.5px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
}

.profile-sub-expired-banner svg { flex-shrink: 0; margin-top: 1px; }

.profile-plans { margin-bottom: 0; }

/* ── FOCUS VISIBLE nos modais ── */
.modal-close:focus-visible,
.modal-btn-back:focus-visible,
.modal-btn-primary:focus-visible,
.login-option-btn:focus-visible,
.btn-logout:focus-visible,
.modal-plan-option:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.modal-field input:focus-visible,
.modal-field select:focus-visible,
.login-code-inputs input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,78,159,0.2);
}

.faq-question:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

/* ── CANCEL MODAL ── */
.cancel-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.cancel-icon-whatsapp { background: rgba(37,211,102,0.12); color: #25D366; }

.cancel-whatsapp-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.cancel-whatsapp-info svg { flex-shrink: 0; margin-top: 1px; color: var(--gray-400); }

.cancel-btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 8px 24px rgba(37,211,102,0.35);
  text-decoration: none;
}

.cancel-btn-whatsapp:hover { transform: translateY(-2px); }

.cancel-btn-keep {
  flex: none;
  width: 100%;
  background: rgba(26,78,159,0.07);
  color: var(--blue-dark);
  font-weight: 800;
}

.cancel-btn-keep:hover { background: rgba(26,78,159,0.12); }

/* ── PROFILE CANCEL BUTTON (plano ativo) ── */
.profile-sub-cancel-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.06);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.profile-sub-cancel-btn:hover {
  background: rgba(220,38,38,0.14);
  border-color: rgba(220,38,38,0.5);
}

/* ── FAQ CANCEL LINK ── */
.faq-cancel-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-cancel-link:hover { color: var(--blue-dark); }

/* ── PRICING CANCEL NOTE ── */
.pricing-cancel-note {
  font-size: 13px;
  color: var(--gray-500);
  margin: 20px 0 32px;
}

.pricing-cancel-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pricing-cancel-link:hover { color: var(--blue-dark); }

/* ── RESPONSIVE ── */
@media (max-width: 560px) {
  .modal-form-grid { grid-template-columns: 1fr; }
  .modal-form-grid .full { grid-column: auto; }
  .modal-body { padding: 28px 20px; }
}
