/* === Smile 360 Trial Modal – Modern & Responsive === */
:root {
  --s360t-bg: #ffffff;
  --s360t-text: #222;
  --s360t-muted: #6b7280; /* gray-500 */
  --s360t-primary: #183F66; /* sky-500 */
  --s360t-primary-dark: #112B46; /* sky-600 */
  --s360t-ring: rgba(24,63,102,.25);
  --s360t-border: #e5e7eb; /* gray-200 */
  --s360t-shadow: 0 20px 50px rgba(2, 8, 23, .25);
  --s360t-radius: 14px;
  --s360t-spacing: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --s360t-bg: #0b1220;
    --s360t-text: #e5e7eb;
    --s360t-muted: #9ca3af;
    --s360t-primary: #38bdf8;
    --s360t-primary-dark: #0ea5e9;
    --s360t-ring: rgba(56,189,248,.25);
    --s360t-border: #1f2937;
    --s360t-shadow: 0 20px 50px rgba(0,0,0,.55);
  }
}

/* Backdrop */
.s360t-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px; /* respiro para scroll */
  background: radial-gradient(60% 60% at 50% 40%, rgba(14,165,233,.15), transparent 70%),
              rgba(0,0,0,.55);
  animation: fadeIn .25s ease-out forwards;
}

.s360t-modal.active { display: flex; overflow: auto; }

/* Dialog */
.s360t-dialog {
  position: relative;
  background: var(--s360t-bg);
  color: var(--s360t-text);
  border-radius: var(--s360t-radius);
  width: min(760px, 100%);
  max-height: 92vh;            /* evita estourar a tela */
  overflow: auto;              /* permite rolagem interna */
  padding: clamp(20px, 3vw, 36px);
  box-shadow: var(--s360t-shadow);
  border: 1px solid var(--s360t-border);
  animation: slideUp .25s ease-out forwards;
  backdrop-filter: saturate(1.2);
}

/* Sticky header para títulos longos */

.s360t-dialog h3 {
  background: var(--s360t-bg);
  margin: 0 0 16px;
  padding-bottom: 12px;
  text-align: center;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  border-bottom: 1px solid var(--s360t-border);
}

/* Subtitle under title */
.s360t-subtitle {
  margin: -6px 0 16px;
  text-align: center;
  font-size: clamp(14px, 1.8vw, 16px);
  font-weight: 600;
  color: var(--s360t-primary);
  letter-spacing: 0.3px;
}

/* Close button */
.s360t-close {
  position: sticky;
  top: 10px;
  float: right; /* mantém acessível em scroll */
  margin-left: auto;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--s360t-muted);
  cursor: pointer;
  transition: color .2s, transform .15s ease;
}
.s360t-close:hover { color: var(--s360t-text); transform: scale(1.05); }

/* Form grid */
.s360t-row { margin-bottom: 12px; }
.s360t-col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 720px) { .s360t-col2 { grid-template-columns: 1fr; } }

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

.s360t-row input[type="text"],
.s360t-row input[type="email"],
.s360t-row input[type="tel"],
.s360t-row input[type="number"],
.s360t-row input[type="password"] {
  width: 100%;
  appearance: none;
  background: transparent;
  color: var(--s360t-text);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--s360t-border);
  outline: 0;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.s360t-row input::placeholder { color: var(--s360t-muted); }

.s360t-row input:focus-visible {
  border-color: var(--s360t-primary);
  box-shadow: 0 0 0 3px var(--s360t-ring);
}


/* Radios estilo limpo (se existirem) */
.s360t-row input[type="radio"] {
  accent-color: var(--s360t-primary);
}

/* Choice pills for PF/PJ (two-column row) */
.s360t-row.s360t-col2 > label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--s360t-border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.65), transparent);
  box-shadow: 0 2px 8px rgba(2, 8, 23, .04);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background-color .2s, transform .12s ease;
}
.s360t-row.s360t-col2 > label:hover { 
  border-color: var(--s360t-primary);
  box-shadow: 0 6px 16px rgba(14,165,233,.12);
}
.s360t-row.s360t-col2 > label:focus-within {
  border-color: var(--s360t-primary);
  box-shadow: 0 0 0 3px var(--s360t-ring);
}
.s360t-row.s360t-col2 > label input[type="radio"] { 
  transform: translateY(1px);
}


/* LGPD row: text first, checkbox after with elegant spacing */
.s360t-lgpd {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}
.s360t-lgpd .s360t-lgpd-text {
  color: var(--s360t-text);
  font-weight: 600;
}
.s360t-lgpd input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--s360t-primary);
}
@media (max-width: 480px) {
  .s360t-lgpd { gap: 10px; }
}

/* Actions */
.s360t-actions { text-align: center; margin-top: 18px; }

.s360t-submit {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #99BB2A, #7FA121);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 20px rgba(153,187,42,.35);
}
.s360t-submit:hover { transform: translateY(-1px); filter: brightness(1.02); }
.s360t-submit:active { transform: translateY(0); filter: brightness(.98); }
.s360t-submit[disabled] { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* Small note under submit */
.s360t-note {
  margin-top: 10px;
  text-align: center;
  color: var(--s360t-muted);
}
.s360t-note small { font-size: 12px; line-height: 1.4; display: inline-block; }

/* Messages */
.s360t-msg { text-align: center; margin-top: 14px; font-size: 14px; color: var(--s360t-muted); }
.s360t-msg.is-error { color: #ef4444; }
.s360t-msg.is-success { color: #16a34a; }

/* Trigger button */
.s360t-open {
  display: inline-block;
  background: linear-gradient(135deg, var(--s360t-primary), var(--s360t-primary-dark));
  color: #fff; border: none;
  padding: 12px 28px; border-radius: 12px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 20px rgba(14,165,233,.35);
}
.s360t-open:hover { transform: translateY(-1px); filter: brightness(1.02); }
.s360t-open:active { transform: translateY(0); filter: brightness(.98); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Scrollbar styling (webkit) */
.s360t-dialog::-webkit-scrollbar { width: 10px; }
.s360t-dialog::-webkit-scrollbar-track { background: transparent; }
.s360t-dialog::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
@media (prefers-color-scheme: dark) {
  .s360t-dialog::-webkit-scrollbar-thumb { background: #334155; }
}


/* Micro spacing tweaks */
.s360t-row { margin-bottom: 14px; }
@media (max-width: 480px) {
  .s360t-modal { padding: 12px; }
  .s360t-dialog { padding: 18px; border-radius: 12px; }
  .s360t-submit, .s360t-open { width: 100%; }
  .s360t-row { margin-bottom: 12px; }
  .s360t-row.s360t-col2 > label { padding: 12px; }
}
/* Password validation feedback */
.s360t-password-hint {
  display: none;
  font-size: 13px;
  color: #ef4444; /* red-500 */
  margin-top: 6px;
  text-align: left;
}

input:invalid + .s360t-password-hint {
  display: block;
}

/* Optional: green success feedback */
.s360t-password-hint.valid {
  color: #16a34a; /* green-600 */
}