/* ============================================================
   NASO Clinical — Design System
   ============================================================ */

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

:root {
  --brand-400: #8ed500;
  --brand-500: #7dc800;
  --brand-600: #68a600;
  --brand-700: #528200;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-950: #4c0519;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,.18);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.28);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.35);
  --shadow-glow: 0 0 40px rgba(125,200,0,.15);

  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 400ms cubic-bezier(.4,0,.2,1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #020617 0%, #0b1120 40%, #0f172a 100%);
  color: var(--slate-200);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--brand-400);
}

/* ── Auth Pages (Login / Cadastro) ── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

/* Subtle decorative blobs for white login */
.auth-container::before,
.auth-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: .10;
  pointer-events: none;
  animation: float 8s ease-in-out infinite alternate;
}
.auth-container::before {
  width: 500px;
  height: 500px;
  background: #2563eb;
  top: -120px;
  right: -80px;
}
.auth-container::after {
  width: 400px;
  height: 400px;
  background: #3b82f6;
  bottom: -100px;
  left: -60px;
  animation-delay: 4s;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.08); }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-2xl);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06);
  animation: cardSlideIn .5s var(--transition) both;
}

/* Auth form inputs override for white login theme */
.auth-card .form-input {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  color: #0f172a;
}
.auth-card .form-input::placeholder {
  color: #94a3b8;
}
.auth-card .form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: #ffffff;
}
.auth-card .form-input:hover:not(:focus) {
  border-color: #cbd5e1;
}
.auth-card .form-label {
  color: #334155;
}
.auth-card .form-input-icon {
  color: #64748b;
}
.auth-card .toggle-password {
  color: #94a3b8;
}
.auth-card .toggle-password:hover {
  color: #0f172a;
}
.auth-card .checkbox-wrapper {
  color: #475569;
}
.auth-card .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .25);
}
.auth-card .btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 24px rgba(37, 99, 235, .35);
  transform: translateY(-1px);
}
.auth-card .divider {
  color: #94a3b8;
}
.auth-card .divider::before,
.auth-card .divider::after {
  background: #e2e8f0;
}
.auth-card .auth-footer {
  color: #475569;
}
.auth-card .auth-footer a {
  color: #2563eb;
}
.auth-card .auth-footer a:hover {
  color: #1d4ed8;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-logo img {
  height: 52px;
  max-width: 200px;
  object-fit: contain;
}

.auth-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.025em;
}

.auth-subtitle {
  text-align: center;
  font-size: .82rem;
  color: #64748b;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--slate-300);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, .6);
  border: 2px solid var(--slate-700);
  border-radius: var(--radius-md);
  color: white;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--slate-500);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(125, 200, 0, .15);
}

.form-input:hover:not(:focus) {
  border-color: var(--slate-600);
}

.form-input-wrapper {
  position: relative;
}

.form-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
  font-size: .85rem;
  pointer-events: none;
}

.form-input.has-icon {
  padding-left: 42px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  font-size: .85rem;
  padding: 4px;
  transition: color var(--transition);
}

.toggle-password:hover {
  color: white;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-size: .82rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .04em;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
  outline: none;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #000;
  box-shadow: 0 4px 16px rgba(125, 200, 0, .25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  box-shadow: 0 6px 24px rgba(125, 200, 0, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(.98);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: .7;
}

.btn-outline {
  background: transparent;
  color: var(--slate-300);
  border: 2px solid var(--slate-700);
}

.btn-outline:hover {
  border-color: var(--brand-500);
  color: var(--brand-400);
  background: rgba(125, 200, 0, .06);
}

/* ── Alerts / Messages ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 18px;
  animation: alertSlide .3s ease both;
}

@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error {
  background: rgba(244, 63, 94, .1);
  border: 1px solid rgba(244, 63, 94, .3);
  color: var(--rose-400);
}

.alert-success {
  background: rgba(125, 200, 0, .1);
  border: 1px solid rgba(125, 200, 0, .3);
  color: var(--brand-400);
}

.alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--slate-500);
  font-size: .75rem;
  font-weight: 500;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--slate-800);
}

/* ── Auth Footer ── */
.auth-footer {
  text-align: center;
  font-size: .8rem;
  color: var(--slate-400);
  margin-top: 20px;
}

.auth-footer a {
  font-weight: 700;
  color: var(--brand-500);
}

/* ── Checkbox custom ── */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--slate-400);
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-500);
  cursor: pointer;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(0,0,0,.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

/* ── Select ── */
.form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, .6);
  border: 2px solid var(--slate-700);
  border-radius: var(--radius-md);
  color: white;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(125, 200, 0, .15);
}

/* ── Toast / Notification ── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-md);
  color: white;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .35s ease both;
  max-width: 360px;
}

.toast.success {
  border-color: rgba(125, 200, 0, .4);
}

.toast.error {
  border-color: rgba(244, 63, 94, .4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ── Password strength ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--slate-800);
  transition: background var(--transition);
}

.strength-segment.active.weak    { background: var(--rose-500); }
.strength-segment.active.medium  { background: #f59e0b; }
.strength-segment.active.strong  { background: var(--brand-500); }

.strength-text {
  font-size: .72rem;
  font-weight: 600;
  margin-top: 4px;
  color: var(--slate-500);
  transition: color var(--transition);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .auth-title {
    font-size: 1.2rem;
  }

  .auth-container::before {
    width: 300px;
    height: 300px;
  }

  .auth-container::after {
    width: 250px;
    height: 250px;
  }
}
