/* Smart Attendance System - Global Styles */
:root {
  /* Default Light Theme (Beige & Peach) */
  --primary: #ff8c42;
  --primary-dark: #e67e3a;
  --secondary: #ffae67;
  --bg-dark: #e6d5c3;
  --bg-card: #f5e9da;
  --bg-input: #ffffff;
  --text-primary: #1e2a47;
  --text-secondary: #5c6b89;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(30, 42, 71, 0.1);

  /* ATTENDIX Light UI */
  --attendix-left: #ffae67;
  --attendix-right: #e6d5c3;
  --attendix-accent: #ff8c42;
  --attendix-input-border: rgba(30, 42, 71, 0.2);
}

.dark-theme {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #22d3ee;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  --attendix-left: #1e2a47;
  --attendix-right: #151d30;
  --attendix-accent: #7c8cff;
  --attendix-input-border: rgba(255, 255, 255, 0.3);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--attendix-right);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===========================================
   ATTENDIX AUTH LAYOUT - Two Panel Design
   =========================================== */

.auth-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Panel - Branding */
.auth-left {
  flex: 0 0 42%;
  background: var(--attendix-left);
  display: flex;
  flex-direction: column;
  padding: 40px;
  position: relative;
  color: #ffffff;
  /* Default color for left panel */
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: auto;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: #ffffff;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
}

.auth-title-section {
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translateY(-50%);
}

.auth-title {
  font-size: 56px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.title-underline {
  width: 80px;
  height: 4px;
  background: #ffffff;
  border-radius: 2px;
}

.auth-footer-link {
  margin-top: auto;
}

.auth-footer-link p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.highlight-link {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.highlight-link:hover {
  opacity: 0.8;
}

/* Right Panel - Form */
.auth-right {
  flex: 1;
  background: var(--attendix-right);
  display: flex;
  flex-direction: column;
  padding: 40px 80px;
  justify-content: center;
}

/* Role Toggle Pill */
.role-toggle-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 60px;
}

.role-toggle-pill {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 6px;
  gap: 4px;
}

.role-toggle-pill input[type="radio"] {
  display: none;
}

.role-btn {
  padding: 12px 36px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  background: transparent;
}

.role-toggle-pill input[type="radio"]:checked+.role-btn {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Auth Form */
.auth-form {
  max-width: 400px;
  width: 100%;
}

.form-group-modern {
  margin-bottom: 40px;
}

.form-group-modern label {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 400;
}

.form-input-underline {
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--attendix-input-border);
  color: var(--text-primary);
  font-size: 16px;
  transition: border-color 0.3s ease;
  outline: none;
}

.form-input-underline:focus {
  border-bottom-color: var(--attendix-accent);
}

.form-input-underline::placeholder {
  color: var(--text-secondary);
}

/* Modern Button */
.btn-modern {
  padding: 16px 48px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.btn-modern:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}

.btn-modern:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive for Auth Layout */
@media (max-width: 900px) {
  .auth-container {
    flex-direction: column;
  }

  .auth-left {
    flex: 0 0 auto;
    min-height: 40vh;
    padding: 30px;
  }

  .auth-title-section {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: auto 0;
  }

  .auth-title {
    font-size: 42px;
  }

  .auth-right {
    padding: 40px 30px;
  }

  .role-toggle-container {
    justify-content: center;
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.container-sm {
  max-width: 450px;
  margin: 0 auto;
  padding: 20px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.card-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

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

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

/* Role Toggle */
.role-toggle {
  display: flex;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.role-toggle input[type="radio"] {
  display: none;
}

.role-toggle label {
  flex: 1;
  text-align: center;
  padding: 12px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.role-toggle input[type="radio"]:checked+label {
  background: var(--primary);
  color: white;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(241, 130, 99, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #ff8c42;
  color: white;
  border: none;
}

.btn-secondary:hover {
  background: #ff8c42;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
}

/* Links */
.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.link:hover {
  color: var(--secondary);
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 24px;
}

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #16a34a;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 42, 71, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header h1 {
  font-size: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-user span {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid rgba(30, 42, 71, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background: var(--bg-input);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 14px;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* QR Section */
.qr-section {
  text-align: center;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
}

.qr-section h2 {
  margin-bottom: 20px;
  font-size: 20px;
}

#qr-container {
  display: inline-block;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin: 20px 0;
}

.qr-timer {
  font-size: 24px;
  font-weight: 700;
  color: var(--warning);
  margin-top: 16px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filters .form-control {
  width: auto;
  min-width: 150px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Auth Page Layout */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .filters {
    flex-direction: column;
  }

  .filters .form-control {
    width: 100%;
  }
}