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

:root {
  --red: #C8102E;
  --red-dark: #9B0C22;
  --navy: #0A1628;
  --navy-mid: #0F2044;
  --navy-light: #1A3360;
  --steel: #3A5070;
  --text: #E8EDF5;
  --muted: #8A9BB5;
  --border: rgba(255,255,255,0.08);
  --input-bg: rgba(255,255,255,0.04);
  --input-border: rgba(255,255,255,0.12);
  --input-focus: rgba(200,16,46,0.5);
}

html, body {
  height: 100%;
  background: var(--navy);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 72px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
  clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
}

.nav-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.nav-subtitle {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-back {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--text); }

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 70% at 50% 50%, rgba(200,16,46,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-box {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.login-box::before,
.login-box::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--red);
  border-style: solid;
  opacity: 0.5;
}

.login-box::before {
  top: -8px; left: -8px;
  border-width: 2px 0 0 2px;
}

.login-box::after {
  bottom: -8px; right: -8px;
  border-width: 0 2px 2px 0;
}

.login-header {
  margin-bottom: 2.5rem;
}

.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.eyebrow-line {
  width: 24px;
  height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

.eyebrow-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 42px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.login-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  border-radius: 0;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--input-focus);
  background: rgba(200,16,46,0.04);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(138, 155, 181, 0.4);
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0a1628 inset !important;
  -webkit-text-fill-color: var(--text) !important;
  border-color: var(--input-focus) !important;
}

.submit-btn {
  width: 100%;
  margin-top: 1.75rem;
  padding: 14px 24px;
  background: var(--red);
  color: white;
  border: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  position: relative;
  overflow: hidden;
}

.submit-btn:hover { background: var(--red-dark); }
.submit-btn:active { transform: scale(0.99); }

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

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.submit-btn.loading .spinner { display: block; }
.submit-btn.loading .btn-text { opacity: 0.7; }

.alert {
  padding: 12px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 3px solid;
  margin-bottom: 1.5rem;
  display: none;
}

.alert.error {
  background: rgba(200,16,46,0.08);
  border-color: var(--red);
  color: #F5A0A0;
  display: block;
}

.alert.success {
  background: rgba(0,200,100,0.08);
  border-color: #00C864;
  color: #80E8B0;
  display: block;
}

.attempt-warning {
  font-size: 12px;
  color: rgba(200,16,46,0.7);
  text-align: center;
  margin-top: 1rem;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.08em;
  min-height: 18px;
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.classification {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(200,16,46,0.5);
}

.activity-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  background: #00C864;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.lockout-overlay {
  display: none;
  position: absolute;
  inset: -20px;
  background: rgba(10,22,40,0.95);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 1rem;
  z-index: 10;
}

.lockout-overlay.active {
  display: flex;
}

.lockout-icon {
  font-size: 40px;
  margin-bottom: 0.5rem;
}

.lockout-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--red);
}

.lockout-timer {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.lockout-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 280px;
}

@media (max-width: 768px) {
  html, body { overflow: auto; }
  .page { min-height: 100vh; height: auto; }
  nav { padding: 0 1.25rem; }
  .main { padding: 1.25rem; align-items: flex-start; padding-top: 2rem; }
  .login-title { font-size: 34px; }
}
