* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --card-bg: white;
  --card-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  --text-primary: #1a1a2e;
  --text-secondary: #666;
  --input-bg: white;
  --input-border: #e2e8f0;
  --input-focus-border: #667eea;
  --btn-primary-bg: linear-gradient(135deg, #667eea, #764ba2);
  --link-color: #667eea;
  --link-hover: #e94560;
  --footer-border: #e2e8f0;
  --brand-bg: rgba(255, 255, 255, 0.05);
}

body.dark-theme {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --card-bg: #1e293b;
  --card-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --input-bg: #334155;
  --input-border: #475569;
  --input-focus-border: #667eea;
  --footer-border: #334155;
  --brand-bg: rgba(255, 255, 255, 0.05);
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s;
  overflow-x: hidden;
}

.theme-toggle-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: 0.3s;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- MAIN FLEX CONTAINER ---------- */
.auth-page-wrapper {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  padding: 20px;
  gap: 20px;
}

/* ---------- LEFT BRAND SIDE ---------- */
.auth-brand-side {
  flex: 1 1 50%;
  background: var(--brand-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* BIGGER CIRCULAR LOGOS */
.brand-logo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 15px 40px rgba(233, 69, 96, 0.4);
  border: 4px solid rgba(255, 255, 255, 0.3);
}

/* BIGGER TEXT */
.brand-department h1 {
  color: #ffffff;
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  letter-spacing: 1px;
}

.brand-department h2 {
  color: #cbd5e1;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.brand-department h3 {
  color: #94a3b8;
  font-size: 1.3rem;
  font-weight: 400;
}

/* ---------- RIGHT CARD SIDE ---------- */
.auth-card-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- THE CARD ITSELF (unchanged) ---------- */
.auth-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 35px;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 420px;
  transition: background 0.3s;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 25px;
  transition: color 0.3s;
}

.back-link:hover {
  color: var(--link-hover);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  font-size: 1.7rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  right: 14px;
  color: #999;
  z-index: 1;
  font-size: 1rem;
}

.form-input {
  width: 100%;
  padding: 14px 45px 14px 15px;
  border: 2px solid var(--input-border);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
  padding: 14px 30px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-block {
  width: 100%;
}

.message-box {
  padding: 15px;
  border-radius: 12px;
  margin-top: 20px;
  text-align: center;
  font-weight: 500;
}

.message-box.error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.message-box.success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

.hidden {
  display: none;
}

.auth-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--footer-border);
}

.auth-footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  color: var(--link-hover);
}

/* ---------- STICKY FOOTER ---------- */
.dashboard-footer {
  text-align: center;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--footer-border);
  color: #cbd5e1;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.dashboard-footer strong {
  color: #ffffff;
  font-weight: 600;
}

/* ---------- RESPONSIVE (small screens) ---------- */
@media (max-width: 768px) {
  .auth-page-wrapper {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }

  .auth-brand-side {
    flex: none;
    padding: 25px 15px;
    border-radius: 20px;
  }

  /* Reduce logo size slightly on mobile */
  .brand-logo {
    width: 100px;
    height: 100px;
  }

  .brand-department h1 {
    font-size: 1.8rem;
  }

  .brand-department h2 {
    font-size: 1.3rem;
  }

  .brand-department h3 {
    font-size: 1.1rem;
  }

  .auth-card-side {
    flex: none;
    padding: 0;
  }

  .auth-card {
    max-width: 100%;
    padding: 30px 25px;
    border-radius: 20px;
  }
}

@media (max-width: 400px) {
  .brand-logo {
    width: 85px;
    height: 85px;
  }

  .brand-department h1 {
    font-size: 1.6rem;
  }

  .brand-department h2 {
    font-size: 1.1rem;
  }

  .brand-department h3 {
    font-size: 1rem;
  }

  .auth-card {
    padding: 25px 18px;
  }
}