/* ═══════════════════════════════════════════════════════════════
   style-cadastro.css — EasyCouvert · Tela de Criação de Conta
   Mantém identidade visual idêntica ao login.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --blue: #99e7ff;
  --purple: #6900ff;
  --purple-mid: #8b3fff;
  --pink: #f5449b;
  --black: #0c0c0d;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(153, 231, 255, 0.15);
  --text: #f0f4ff;
  --muted: rgba(240, 244, 255, 0.55);
  --radius-lg: 20px;
  --radius-sm: 10px;
  --trans: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: "Lato", sans-serif;
  min-height: 100vh;
  background: var(--black);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* ── Background blobs ───────────────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6900ff 0%, transparent 70%);
  top: -160px;
  left: -160px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #99e7ff 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  animation-delay: -6s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #f5449b 0%, transparent 70%);
  top: 50%;
  left: 55%;
  opacity: 0.22;
  animation-delay: -12s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, 20px) scale(1.08);
  }
}

/* Noise texture overlay */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── Layout wrapper ─────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px; /* ligeiramente maior que o login por ter mais campos */
  padding: 2rem 1.25rem 3rem;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Brand / Logo ───────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: block;
  filter: drop-shadow(0 0 18px rgba(105, 0, 255, 0.55));
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 18px rgba(105, 0, 255, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 32px rgba(153, 231, 255, 0.65));
  }
}

.brand-name {
  font-family: "Syne", sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(
    135deg,
    var(--blue) 0%,
    var(--purple-mid) 50%,
    var(--pink) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.brand-sub {
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(153, 231, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Accent line no topo */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--purple-mid),
    var(--blue),
    transparent
  );
  border-radius: 0 0 4px 4px;
}

.card-title {
  font-family: "Syne", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  text-align: center;
  letter-spacing: -0.3px;
}

.card-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* ── Alertas ────────────────────────────────────────────────── */
.alert {
  display: none;
  align-items: center;
  gap: 0.6rem;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.alert.visible {
  display: flex;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* ── Form grid (2 colunas para senha / confirmar) ───────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

/* Ocupa as 2 colunas */
.form-group.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* ── Input wrap ─────────────────────────────────────────────── */
.input-wrap {
  position: relative;
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 0.82rem 1.05rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(153, 231, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  font-family: "Lato", sans-serif;
  transition: var(--trans);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.input-wrap input::placeholder {
  color: rgba(240, 244, 255, 0.3);
}

.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--purple-mid);
  background: rgba(139, 63, 255, 0.08);
  box-shadow:
    0 0 0 3px rgba(105, 0, 255, 0.2),
    0 0 20px rgba(105, 0, 255, 0.1);
}

.input-wrap input.input-error,
.input-wrap select.input-error {
  border-color: rgba(239, 68, 68, 0.6);
}

/* Select arrow customizado */
.input-wrap select {
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b3fff' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.input-wrap select option {
  background: #1a1025;
  color: var(--text);
}

/* Inputs com toggle de senha precisam de padding-right */
.input-wrap input.has-toggle {
  padding-right: 3rem;
}

/* ── Toggle senha ───────────────────────────────────────────── */
.toggle-pw {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.2rem;
  transition: color 0.2s;
  line-height: 1;
}

.toggle-pw:hover {
  color: var(--blue);
}

/* ── Erro de campo ──────────────────────────────────────────── */
.field-error {
  font-size: 0.76rem;
  color: #fca5a5;
  margin-top: 0.3rem;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── Medidor de força de senha ──────────────────────────────── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.strength-bar span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s;
}

/* s1 = fraca */
.strength-bar.s1 span:nth-child(1) {
  background: #ef4444;
}
/* s2 = razoável */
.strength-bar.s2 span:nth-child(-n + 2) {
  background: #f59e0b;
}
/* s3 = boa */
.strength-bar.s3 span:nth-child(-n + 3) {
  background: #3b82f6;
}
/* s4 = forte */
.strength-bar.s4 span {
  background: #10b981;
}

.strength-label {
  font-size: 0.73rem;
  margin-top: 0.3rem;
  min-height: 1rem;
  color: var(--muted);
  transition: color 0.3s;
}

/* ── Botão submit ───────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 0.95rem;
  margin-top: 0.75rem;
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-mid) 60%,
    #a855f7 100%
  );
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  font-weight: 700;
  font-family: "Lato", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(105, 0, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-submit:hover:not(:disabled)::before {
  opacity: 1;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(105, 0, 255, 0.6);
}
.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner de loading */
.spin {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-submit.loading .spin {
  display: block;
}
.btn-submit.loading .btn-label {
  display: none;
}
.btn-submit.loading .load-label {
  display: inline;
}
.load-label {
  display: none;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Link de login ──────────────────────────────────────────── */
.link-login {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.link-login a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.link-login a:hover {
  color: #fff;
}

/* ── Footer ─────────────────────────────────────────────────── */
.page-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(240, 244, 255, 0.3);
  letter-spacing: 0.05em;
}

/* ── Responsivo ─────────────────────────────────────────────── */

/* Tablet: colapsa 2 colunas em 1 */
@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: 1;
  }

  .card {
    padding: 2rem 1.5rem;
  }

  .brand-name {
    font-size: 1.7rem;
  }

  .logo-mark {
    width: 60px;
    height: 60px;
  }
}

/* Mobile pequeno */
@media (max-width: 360px) {
  .card {
    padding: 1.75rem 1.1rem;
  }

  .card-title {
    font-size: 1.2rem;
  }
}
