/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red: #d32f2f;
  --red-dark: #b71c1c;
  --red-light: #ffebee;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(211,47,47,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(211,47,47,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.login-brand {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.brand-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(211,47,47,0.3));
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  font-weight: 400;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-card-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-card-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== FORM FIELDS ===== */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  line-height: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

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

.input-wrapper input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
}

.input-wrapper input.error {
  border-color: var(--red);
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--red-light);
  color: var(--red-dark);
  border: 1px solid #ffcdd2;
}

.hidden {
  display: none !important;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #e57373;
  cursor: not-allowed;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-text { transition: opacity 0.2s; }
.btn-loader svg { display: block; }

/* ===== LOGIN FOOTER ===== */
.login-footer {
  margin-top: 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  position: relative;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 24px;
  }
  .brand-icon {
    font-size: 48px;
  }
  .brand-title {
    font-size: 24px;
  }
}
