*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0e0a06;
  --bg2: #130d07;
  --orange: #f97316;
  --orange-dark: #c2410c;
  --text: #e8eaf0;
  --muted: #8b8fa8;
  --border: rgba(255,255,255,0.07);
  --card: rgba(255,255,255,0.05);
  --input-bg: #130d07;
  --red: #f04040;
  --green: #4ade80;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Exo 2', sans-serif;
  background:
    radial-gradient(ellipse 80% 40% at 30% 0%, rgba(200,120,0,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 60% 100%, rgba(180,40,0,0.22) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(180,80,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,80,0,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}

.auth-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

/* === CARD === */
.modal {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(249,115,22,0.15);
  border-radius: 20px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 60px rgba(180,60,0,0.08);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

/* top accent line */
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  border-radius: 100px;
}

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}
.back-link:hover { color: var(--orange); }

/* === ICON === */
.modal-icon {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(249,115,22,0.35);
}

.modal-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.modal-sub {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* === FIELDS === */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.field-input {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'Exo 2', sans-serif;
  padding: 13px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

.field-input::placeholder { color: rgba(139,143,168,0.4); }

.field-input:focus {
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.08);
}

/* === ERRORS === */
.error-msg {
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 600;
  margin-top: 2px;
  animation: shakeIn 0.3s ease;
}

/* === STRENGTH BAR === */
.strength-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  margin-top: 6px;
  overflow: hidden;
}

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

.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 3px;
  display: block;
}

/* === PRIMARY BUTTON === */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Exo 2', sans-serif;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 20px rgba(249,115,22,0.35);
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(249,115,22,0.5);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* === DIVIDER === */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

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

/* === SWITCH TEXT === */
.switch-text {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.switch-text a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.switch-text a:hover { color: #fb923c; }

/* === EYE BUTTON === */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper .field-input {
  padding-right: 44px;
  width: 100%;
}
.eye-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s;
  line-height: 0;
}
.eye-btn:hover { color: var(--orange); }

/* === ANIMATIONS === */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shakeIn {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@media (max-width: 480px) {
  .modal {
    margin: 0;
    padding: 32px 20px 28px;
    border-radius: 16px;
  }
  .modal-title { font-size: 1.5rem; }
  .field-input {
    font-size: 16px;
    padding: 14px 16px;
  }
  .btn-primary {
    padding: 16px;
    font-size: 1rem;
  }
}
