:root {
  --auth-bg: #0f172a;
  --auth-surface: #1e293b;
  --auth-border: #334155;
  --auth-text: #f1f5f9;
  --auth-muted: #94a3b8;
  --auth-primary: #3b82f6;
  --auth-primary-light: #60a5fa;
  --auth-gradient: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

body.auth-modern {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--auth-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo img {
  height: 48px;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--auth-text);
  margin: 0;
}

.auth-logo p {
  font-size: 14px;
  color: var(--auth-muted);
  margin: 4px 0 0;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.auth-form .input-wrap {
  position: relative;
}

.auth-form .input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--auth-muted);
}

.auth-form .input-wrap .toggle-vis {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  color: var(--auth-text);
  font-size: 15px;
  transition: all 0.2s;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: rgba(255,255,255,0.06);
}

.auth-form input::placeholder {
  color: var(--auth-muted);
  opacity: 0.6;
}

.auth-form .form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.auth-form .form-actions a {
  font-size: 13px;
  color: var(--auth-primary-light);
  text-decoration: none;
}

.auth-form .form-actions a:hover {
  text-decoration: underline;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: var(--auth-primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.auth-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 14px rgba(59,130,246,0.3);
  transform: translateY(-1px);
}

.auth-footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-footer-text a {
  color: var(--auth-primary-light);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--auth-muted);
  font-size: 12px;
}

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

/* PIN page */
.auth-pin-display {
  text-align: center;
  margin-bottom: 24px;
}

.auth-pin-display .user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--auth-border);
  margin-bottom: 12px;
}

.auth-pin-display h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0 0 4px;
}

.auth-pin-display p {
  font-size: 14px;
  color: var(--auth-muted);
  margin: 0;
}

.auth-pin-input {
  text-align: center;
  margin-bottom: 24px;
}

.auth-pin-input input {
  width: 100%;
  max-width: 240px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-text);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 12px;
  outline: none;
}

.auth-pin-input input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.auth-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto;
}

.auth-numpad button {
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-text);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-numpad button:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--auth-primary);
}

.auth-numpad button:active {
  transform: scale(0.95);
}

.auth-numpad .action-btn {
  color: var(--auth-muted);
  font-size: 14px;
}

/* Signup specific */
.auth-signup-card {
  max-width: 700px;
  padding: 32px;
}

.auth-signup-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.auth-signup-card .form-group.full {
  grid-column: 1 / -1;
}

.auth-signup-card select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  color: var(--auth-text);
  font-size: 15px;
  outline: none;
}

.auth-signup-card select:focus {
  border-color: var(--auth-primary);
}

.auth-signup-card select option {
  background: var(--auth-surface);
  color: var(--auth-text);
}

.auth-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.auth-step {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--auth-border);
  transition: all 0.3s;
}

.auth-step.active {
  background: var(--auth-primary);
  width: 48px;
}

.auth-step.done {
  background: #10b981;
}

.auth-step-label {
  font-size: 13px;
  color: var(--auth-muted);
  text-align: center;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .auth-signup-card .form-row {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 28px 20px;
  }
}
