/* ============================================================
   S.A.P.O.S. — Cadastro  |  style.css
   Dark theme (One Dark inspired) + frog brand
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette */
  --bg-base: #1a1d23;
  --bg-card: #21252b;
  --bg-input: #2c313a;
  --bg-input-focus: #323842;

  --border: #3d4452;
  --border-focus: #61af4f;

  --text-primary: #abb2bf;
  --text-bright: #e5e9f0;
  --text-muted: #5c6370;
  --text-label: #e5e9f0;

  /* Brand — frog green */
  --green: #61af4f;
  --green-dark: #4c9340;
  --green-glow: rgba(97, 175, 79, 0.18);
  --green-subtle: rgba(97, 175, 79, 0.10);

  /* Status */
  --color-success: #61af4f;
  --color-error: #e06c75;
  --color-warn: #e5c07b;

  /* Sizing */
  --radius-card: 18px;
  --radius-input: 10px;
  --radius-btn: 10px;

  /* Font */
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  background-image: url(./pattern.jpg);
  background-repeat: repeat;
  background-size: 360px;
}

/* ── Background particles ─────────────────────────────────── */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  opacity: 0.04;
  animation: float linear infinite;
  user-select: none;
}

.particle:nth-child(1) {
  left: 8%;
  animation-duration: 22s;
  animation-delay: 0s;
  top: -40px;
}

.particle:nth-child(2) {
  left: 25%;
  animation-duration: 30s;
  animation-delay: -8s;
  top: -40px;
}

.particle:nth-child(3) {
  left: 50%;
  animation-duration: 25s;
  animation-delay: -4s;
  top: -40px;
}

.particle:nth-child(4) {
  left: 72%;
  animation-duration: 28s;
  animation-delay: -15s;
  top: -40px;
}

.particle:nth-child(5) {
  left: 90%;
  animation-duration: 20s;
  animation-delay: -6s;
  top: -40px;
}

@keyframes float {
  to {
    transform: translateY(110dvh) rotate(30deg);
  }
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 840px;
  padding: 40px;
  display: flex;
  flex-direction: row;
  gap: 40px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 60px var(--green-glow);
  animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  padding-right: 40px;
}

.card-right {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Header ───────────────────────────────────────────────── */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.ascii-frog {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--green);
  text-shadow: 0 0 12px var(--green-glow);
  white-space: pre;
  display: inline-block;
  margin-bottom: 12px;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-bright);
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--green-subtle);
  border: 1px solid rgba(97, 175, 79, 0.3);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Notification banner ──────────────────────────────────── */
.notification {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid transparent;
  animation: notif-in 0.3s ease both;
}

@keyframes notif-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification.hidden {
  display: none;
}

.notification.success {
  background: rgba(97, 175, 79, 0.12);
  border-color: rgba(97, 175, 79, 0.3);
  color: #8bcc77;
}

.notification.error {
  background: rgba(224, 108, 117, 0.12);
  border-color: rgba(224, 108, 117, 0.3);
  color: #e87c84;
}

.notification.warn {
  background: rgba(229, 192, 123, 0.10);
  border-color: rgba(229, 192, 123, 0.3);
  color: #e5c07b;
}

.notification-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Form ─────────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-label);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-icon {
  font-size: 0.85rem;
}

/* Input wrapper (input + suffix or toggle) */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  height: 46px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(97, 175, 79, 0.15);
}

/* Login field — suffix squeezes right side */
#group-login .field-input {
  padding-right: 130px;
}

.input-suffix {
  position: absolute;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

/* Password toggle button */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.toggle-pw:hover {
  color: var(--green);
}

/* ── Strength bar ─────────────────────────────────────────── */
.password-strength {
  height: 3px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
  margin-top: -2px;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 100px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* ── Field errors ─────────────────────────────────────────── */
.field-error {
  font-size: 0.76rem;
  color: var(--color-error);
  display: block;
  margin-top: 2px;
  animation: shake 0.4s ease both;
}

.field-error:empty {
  display: none;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

/* Invalid state */
.field-group.invalid .field-input {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(224, 108, 117, 0.12);
}

/* ── Submit button ────────────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  height: 48px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #1a1d23;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(97, 175, 79, 0.35);
  text-transform: uppercase;
}

.btn-submit:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(97, 175, 79, 0.45);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(26, 29, 35, 0.35);
  border-top-color: #1a1d23;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner.hidden {
  display: none;
}

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

/* ── Footer ───────────────────────────────────────────────── */
.card-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.card-footer strong {
  color: var(--text-primary);
}

.version {
  opacity: 0.5;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 768px) {
  .card {
    flex-direction: column;
    max-width: 440px;
    padding: 28px 24px;
    gap: 24px;
  }

  .card-left {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    gap: 20px;
  }

  .card-right {
    flex: unset;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
  }

  .ascii-frog {
    font-size: 0.62rem;
  }
}