/* Primeira entrada da conta (terapeuta, pais ou clínica) e aviso de plano encerrado: mesmo céu das
   telas de entrar e de aprendizes. */
.workspace-gate {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, #29a8f3 0%, #35b2fa 22%, #4abffe 45%, #68cdfd 68%, #92dcfa 100%);
}

.workspace-gate[hidden],
.workspace-gate [hidden] {
  display: none !important;
}

.workspace-gate-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.workspace-gate h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  font-weight: 950;
  line-height: 1.05;
  text-wrap: balance;
  text-shadow: 0 4px 6px rgba(5, 22, 38, 0.7);
}

.workspace-gate-subtitle {
  margin: 0;
  max-width: 560px;
  color: #ffffff;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(5, 22, 38, 0.6);
}

.workspace-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.workspace-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 18px 14px;
  border: 0;
  border-radius: 24px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(9, 54, 94, 0.18), 0 18px 30px rgba(9, 54, 94, 0.22);
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.workspace-option:active {
  transform: scale(0.97);
}

.workspace-option-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.workspace-option strong {
  color: #0f5c99;
  font-size: 1.2rem;
  font-weight: 950;
}

.workspace-option small {
  color: #475569;
  font-weight: 800;
}

.workspace-option.is-soon {
  opacity: 0.6;
  cursor: default;
}

.workspace-clinic-form {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 8px 0 rgba(9, 54, 94, 0.18), 0 18px 30px rgba(9, 54, 94, 0.22);
}

.workspace-clinic-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 900;
}

.workspace-clinic-form input {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}

.workspace-clinic-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.workspace-clinic-actions .auth-submit {
  min-width: 180px;
  padding: 0 22px;
}

#workspaceBlocked .auth-link {
  color: #ffffff;
}

.workspace-gate .auth-message {
  max-width: 440px;
}

/* Plano embaixo de "Quem vai treinar hoje?": linha própria, abaixo da conta. */
.profile-picker-plan {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f5c99;
  font-weight: 900;
  text-shadow: none;
  box-shadow: 0 4px 10px rgba(9, 54, 94, 0.18);
}

.profile-picker-plan[hidden] {
  display: none;
}

/* Teste grátis: cartão em destaque, com os dias que faltam (laranja nos 3 últimos dias). */
.profile-picker-plan.is-trial {
  padding: 10px 22px 10px 12px;
  border: 3px solid #ffffff;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff7d6, #ffe58a);
  color: #7a4a00;
  box-shadow: 0 6px 0 #e0a800, 0 14px 24px rgba(9, 54, 94, 0.25);
}

.profile-picker-plan.is-trial.is-ending {
  background: linear-gradient(180deg, #ffe4d6, #ffb38a);
  color: #8a2c00;
  box-shadow: 0 6px 0 #e06a00, 0 14px 24px rgba(9, 54, 94, 0.25);
}

.profile-plan-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  font-size: 1.5rem;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.profile-plan-text {
  display: grid;
  text-align: left;
  line-height: 1.15;
}

.profile-plan-text strong {
  font-size: 1.12rem;
  font-weight: 950;
}

.profile-plan-text small {
  color: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  opacity: 0.8;
}

/* Preço na tela de teste terminado / plano inativo. */
.workspace-price-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  border-radius: 24px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 8px 0 rgba(9, 54, 94, 0.18), 0 18px 30px rgba(9, 54, 94, 0.22);
}

.workspace-price-card strong {
  color: #0f5c99;
  font-size: 1.9rem;
  font-weight: 950;
}

.workspace-price-card small {
  color: #475569;
  font-weight: 800;
}

.workspace-price-card .auth-submit {
  width: 100%;
  margin-top: 6px;
}

.workspace-price-card .workspace-price-note {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Botão de assinar / minha assinatura dentro do cartão do plano. */
.profile-plan-button {
  min-height: 40px;
  margin-left: 6px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #4abffe, #1d8fe0);
  color: #ffffff;
  font: inherit;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 0 4px 0 #14659f;
  cursor: pointer;
}

.profile-plan-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Aviso rápido (pagamento recebido, plano ativado...). */
.billing-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 120;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 16px;
  background: #166534;
  color: #ffffff;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 24px rgba(9, 54, 94, 0.3);
}

.billing-toast[hidden] {
  display: none;
}

.billing-toast[data-kind="wait"] {
  background: #0f5c99;
}

.billing-toast[data-kind="error"] {
  background: #b91c1c;
}

@media (max-width: 560px) {
  .workspace-options {
    grid-template-columns: 1fr;
  }

  .workspace-option {
    min-height: 0;
  }
}

/* Logo da clínica antes do nome (supabase/10-nomes-e-logo.sql). */
.profile-plan-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
}

/* "Meu nome" do terapeuta de clínica, abaixo da conta (features/names-and-logo.js). */
.my-name-form {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: min(560px, 100%);
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f5c99;
  font-weight: 900;
}

.my-name-form[hidden] {
  display: none;
}

.my-name-form input {
  flex: 1 1 220px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
}

.my-name-message {
  flex-basis: 100%;
  color: #475569;
  text-align: center;
}

.my-name-message:empty {
  display: none;
}
