/* ============================================================
   /Secretaria/NovoAluno — Auto-cadastro público de aluno (v2)
   Estilos específicos da página. Componentes globais v2
   (.btn-primary-v2, .card-v2, .auth-shell, .auth-card, .auth-body, .auth-title,
    .form-field, .form-input, etc.) vêm do site.css.
   Baseado em docs/prototipos/usuario-novoaluno/index.html.
   ============================================================ */

/* Shell e fundo decorativo (mesma vibe da página de login). */
.auth-shell-novoaluno { position: relative; overflow: hidden; }
.auth-shell-novoaluno::before {
  content: "";
  position: absolute; top: -140px; right: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(38, 56, 104, .10), transparent 65%);
  pointer-events: none;
}
.auth-shell-novoaluno::after {
  content: "";
  position: absolute; bottom: -180px; left: -160px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(44, 183, 56, .10), transparent 65%);
  pointer-events: none;
}
[data-theme="dark"] .auth-shell-novoaluno::before {
  background: radial-gradient(circle at center, rgba(59, 130, 246, .12), transparent 65%);
}
[data-theme="dark"] .auth-shell-novoaluno::after {
  background: radial-gradient(circle at center, rgba(44, 183, 56, .08), transparent 65%);
}

/* Container do conteúdo (substitui o auth-card pra ficar mais largo). */
.novoaluno-wrap { width: 100%; max-width: 720px; margin: 0 auto; }

/* Reduz padding lateral do auth-main no mobile para os blocos ocuparem
   mais espaço horizontal. O _LayoutAuthV2 aplica padding-padrão maior. */
.auth-shell-novoaluno .auth-main { padding: 8px 12px 40px; }
@media (min-width: 768px) {
  .auth-shell-novoaluno .auth-main { padding: 8px 24px 48px; }
}

/* Cabeçalho da página. */
.novoaluno-head { text-align: center; margin: 8px auto 20px; max-width: 520px; }
.novoaluno-head .logo-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--sis-blue) 0%, #3350A8 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; margin: 0 auto 12px;
  box-shadow: 0 2px 8px rgba(38, 56, 104, .25);
}
.novoaluno-head h1 { font-size: 22px; font-weight: 600; color: var(--text-primary); letter-spacing: -.3px; margin-bottom: 4px; }
.novoaluno-head p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.novoaluno-head .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }

/* Card de seção numerada (reaproveita .card-v2.accent-blue).
   Sobrescreve display:flex herdado de .card-head (site.css/_shared.css) para
   empilhar título e helper verticalmente — mobile-first. */
.novoaluno-wrap .section-card { margin-bottom: 14px; position: relative; }
.novoaluno-wrap .section-card .card-head { padding: 14px 16px 4px; display: block; }
.novoaluno-wrap .section-card .card-head h2 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.novoaluno-wrap .section-card .card-head h2 .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-info-bg); color: var(--color-info-text);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 600;
}
.novoaluno-wrap .section-card .card-head .helper { font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; display: block; }
.novoaluno-wrap .section-body { padding: 8px 16px 18px; }

/* Form fields — mobile-first: 1 input por linha. Multi-coluna só a partir de 640px. */
.novoaluno-wrap .fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.novoaluno-wrap .fld-row { display: flex; flex-direction: column; gap: 12px; }
.novoaluno-wrap .fld-row > .fld { flex: 1 1 100%; min-width: 0; margin-bottom: 0; }
.novoaluno-wrap .fld-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); letter-spacing: .02em; }
.novoaluno-wrap .fld-label .req { color: var(--color-danger-text); font-weight: 600; }
.novoaluno-wrap .fld-label .opt { font-size: 10px; color: var(--text-tertiary); font-weight: 400; text-transform: lowercase; }
.novoaluno-wrap .fld-label a { color: var(--sis-blue); font-size: 11px; font-weight: 500; text-decoration: none; margin-left: auto; }
.novoaluno-wrap .fld-label a:hover { text-decoration: underline; }
[data-theme="dark"] .novoaluno-wrap .fld-label a { color: #93B4FF; }

.novoaluno-wrap .fld-wrap { position: relative; }
.novoaluno-wrap .fld-input,
.novoaluno-wrap .fld-select {
  width: 100%; height: 40px; padding: 0 12px;
  border: .5px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-card); color: var(--text-primary);
  font-family: inherit; font-size: 13px; transition: all var(--transition-fast);
  outline: none;
}
.novoaluno-wrap .fld-input:hover,
.novoaluno-wrap .fld-select:hover { border-color: var(--border-emphasis); }
.novoaluno-wrap .fld-input:focus,
.novoaluno-wrap .fld-select:focus { border-color: var(--sis-blue); box-shadow: 0 0 0 3px rgba(38, 56, 104, .10); }
.novoaluno-wrap .fld-input::placeholder { color: var(--text-tertiary); }
.novoaluno-wrap .fld-input.with-toggle { padding-right: 40px; }
.novoaluno-wrap .fld-input.with-suffix { padding-right: 42px; }
.novoaluno-wrap .fld-input:read-only,
.novoaluno-wrap .fld-input[readonly] { background: var(--surface-elevated); color: var(--text-secondary); cursor: default; }
.novoaluno-wrap .fld-input.is-invalid,
.novoaluno-wrap .fld-select.is-invalid { border-color: var(--color-danger-text); box-shadow: 0 0 0 3px rgba(153, 27, 27, .08); }
.novoaluno-wrap .fld-input.is-valid { border-color: var(--sis-green); }

.novoaluno-wrap .fld-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236B7280' d='M4.5 6l3.5 3.5L11.5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

.novoaluno-wrap .fld-suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-tertiary); font-weight: 500;
  pointer-events: none; display: flex; align-items: center; gap: 6px;
}
.novoaluno-wrap .fld-suffix .spinner-sm {
  width: 13px; height: 13px;
  border: 2px solid var(--border-default); border-top-color: var(--sis-blue);
  border-radius: 50%; animation: novoalunoSpin .7s linear infinite;
}

.novoaluno-wrap .fld-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent;
  color: var(--text-tertiary); cursor: pointer; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: color var(--transition-fast);
}
.novoaluno-wrap .fld-toggle:hover { color: var(--text-primary); background: var(--surface-hover); }

.novoaluno-wrap .fld-error {
  display: none; align-items: center; gap: 4px; font-size: 11px;
  color: var(--color-danger-text); margin-top: 2px; font-weight: 500;
}
.novoaluno-wrap .fld-error.show { display: inline-flex; }
.novoaluno-wrap .fld-error i { font-size: 12px; }

.novoaluno-wrap .fld-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.4; }

/* Foto: crop inline (ADR-021) — wrapper centralizado.
   O componente _CropInlineFoto.cshtml já traz seus próprios estilos via Componentes/crop-inline-foto.css. */
.novoaluno-photo-block { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.novoaluno-photo-block .photo-required-hint { font-size: 11px; color: var(--text-secondary); text-align: center; }
.novoaluno-photo-block .photo-required-hint .req { color: var(--color-danger-text); font-weight: 600; }

/* Checklist de senha — mobile-first: 1 coluna. */
.novoaluno-wrap .pwd-checklist {
  display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 6px;
  padding: 10px 12px; background: var(--surface-elevated);
  border-radius: var(--radius-md); border: .5px solid var(--border-subtle);
}
.novoaluno-wrap .pwd-check { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); transition: color var(--transition-fast); }
.novoaluno-wrap .pwd-check i { font-size: 13px; color: var(--text-tertiary); transition: color var(--transition-fast); flex-shrink: 0; }
.novoaluno-wrap .pwd-check.ok { color: var(--color-success-text); }
.novoaluno-wrap .pwd-check.ok i { color: var(--color-success-text); }

/* Section toggle: responsável condicional. */
.novoaluno-wrap .section-card.responsavel-card { display: none; }
.novoaluno-wrap .section-card.responsavel-card.visible { display: block; animation: novoalunoSlideDown .25s ease; }
@keyframes novoalunoSlideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.novoaluno-wrap .idade-info {
  display: none; font-size: 11px; font-weight: 500; padding: 4px 8px;
  border-radius: 6px; background: var(--color-info-bg); color: var(--color-info-text);
  margin-top: 4px; align-items: center; gap: 4px;
}
.novoaluno-wrap .idade-info.show { display: inline-flex; }
.novoaluno-wrap .idade-info.menor { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* Footer do formulário. */
.novoaluno-wrap .form-footer {
  margin-top: 16px; padding: 18px 20px;
  background: var(--surface-card); border: .5px solid var(--border-default);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 12px;
}
.novoaluno-wrap .form-actions { display: flex; flex-direction: column; gap: 8px; }
.novoaluno-wrap .form-footer-note {
  font-size: 11.5px; line-height: 1.5; text-align: center;
  padding: 10px 12px; background: var(--color-info-bg);
  color: var(--color-info-text); border-radius: var(--radius-md);
}
.novoaluno-wrap .form-footer-note i { margin-right: 4px; }

/* Alerta inline (erro de submissão) — pode listar campos específicos. */
.novoaluno-wrap .form-alert {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--color-danger-bg); color: var(--color-danger-text);
  font-size: 12.5px; font-weight: 500; margin-bottom: 14px;
  border: .5px solid rgba(153, 27, 27, .15);
}
.novoaluno-wrap .form-alert.show { display: flex; }
.novoaluno-wrap .form-alert > i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.novoaluno-wrap .form-alert .form-alert-sub {
  margin-top: 4px; font-weight: 500; opacity: .9;
}
.novoaluno-wrap .form-alert-list {
  margin: 6px 0 0; padding-left: 18px; line-height: 1.55;
}
.novoaluno-wrap .form-alert-list li { margin-top: 2px; font-weight: 400; }
.novoaluno-wrap .form-alert-list a {
  color: var(--color-danger-text); font-weight: 600; text-decoration: underline;
  cursor: pointer;
}
.novoaluno-wrap .form-alert-list a:hover { opacity: .85; }

/* Tela de sucesso (overlay). */
.novoaluno-success-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15, 17, 23, .65);
  backdrop-filter: blur(4px); align-items: center; justify-content: center;
  z-index: 1050; padding: 16px;
}
.novoaluno-success-overlay.show { display: flex; animation: novoalunoFadeIn .2s ease; }
@keyframes novoalunoFadeIn { from { opacity: 0; } to { opacity: 1; } }
.novoaluno-success-overlay .success-card {
  background: var(--surface-card); border-radius: var(--radius-lg);
  max-width: 440px; width: 100%; overflow: hidden; position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
}
.novoaluno-success-overlay .success-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--sis-blue) 0%, var(--sis-blue) 60%, var(--sis-green) 60%, var(--sis-green) 100%);
}
.novoaluno-success-overlay .success-body { padding: 32px 24px 24px; text-align: center; }
.novoaluno-success-overlay .success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--color-success-bg); color: var(--color-success-text);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  margin: 0 auto 16px;
}
.novoaluno-success-overlay h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.novoaluno-success-overlay p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 20px; }
.novoaluno-success-overlay p b { color: var(--text-primary); }

@keyframes novoalunoSpin { to { transform: rotate(360deg); } }

/* Desktop (≥ 640px): inputs voltam a múltiplas colunas. */
@media (min-width: 640px) {
  .novoaluno-wrap .fld-row { flex-direction: row; flex-wrap: wrap; }
  .novoaluno-wrap .fld-row > .fld { flex: 1 1 calc(50% - 6px); min-width: 140px; }
  .novoaluno-wrap .fld-row.cols-3 > .fld { flex: 1 1 calc(33.33% - 8px); }
  .novoaluno-wrap .fld-row.cep-row > .fld:first-child { flex: 0 0 140px; }
  .novoaluno-wrap .fld-row.numero-row > .fld:first-child { flex: 0 0 100px; }
  .novoaluno-wrap .pwd-checklist { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .novoaluno-wrap .form-actions { flex-direction: row-reverse; }
  .novoaluno-wrap .form-actions .btn-secondary-v2 { flex: 0 0 140px; }
  .novoaluno-wrap .form-actions .btn-primary-v2 { flex: 1; }
}
@media (min-width: 768px) {
  .novoaluno-head { margin-top: 16px; }
  .novoaluno-head h1 { font-size: 24px; }
  .novoaluno-wrap .section-body { padding: 8px 24px 20px; }
  .novoaluno-wrap .section-card .card-head { padding: 16px 24px 4px; }
}
