/* ── login.css — Premium dark-themed login page styles ── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg:           #0d0f14;
  --surface:      #161a24;
  --surface-2:    #1e2333;
  --border:       rgba(255,255,255,0.08);
  --accent:       #e5484d;
  --accent-dim:   rgba(229,72,77,0.15);
  --text:         #e8eaf0;
  --text-dim:     #6b7385;
  --text-muted:   #4a5165;
  --success:      #30a46c;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 24px 64px rgba(0,0,0,0.6);
}

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

/* ── Background animated blobs ─────────────────────────────────────────────── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  animation: blobFloat 12s ease-in-out infinite alternate;
}
.blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #e5484d, transparent);
  top: -120px; left: -120px;
  animation-duration: 14s;
}
.blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #3e8ede, transparent);
  bottom: -80px; right: -80px;
  animation-duration: 10s;
  animation-delay: -4s;
}
.blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #9b6dd6, transparent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 18s;
  animation-delay: -8s;
}
@keyframes blobFloat {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(30px, -30px); }
}

/* ── Layout ────────────────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Brand Panel (left) ─────────────────────────────────────────────────────── */
.login-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: linear-gradient(135deg, rgba(229,72,77,0.08) 0%, rgba(61,40,80,0.12) 100%);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.brand-content {
  max-width: 360px;
}

.brand-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
  animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(229,72,77,0.3)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 24px rgba(229,72,77,0.6)); }
}

.brand-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #e5484d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(232,234,240,0.7);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(229,72,77,0.15);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Form Panel ───────────────────────────────────────────────────────── */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card-header {
  margin-bottom: 32px;
}

.login-card-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-card-header p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

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

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 13px 14px 13px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:focus {
  border-color: rgba(229,72,77,0.5);
  box-shadow: 0 0 0 3px rgba(229,72,77,0.1);
}

input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent);
}

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

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--text); }

/* Error state */
.form-group.has-error input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229,72,77,0.15);
}

/* ── Error message ───────────────────────────────────────────────────────────── */
.error-msg {
  background: rgba(229,72,77,0.1);
  border: 1px solid rgba(229,72,77,0.3);
  border-radius: var(--radius-sm);
  color: #ff8082;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* ── Login Button ────────────────────────────────────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #e5484d 0%, #c73237 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(229,72,77,0.35);
  margin-top: 8px;
}
.btn-login:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(229,72,77,0.45);
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.login-footer {
  margin-top: 24px;
  text-align: center;
}
.login-footer p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Auth header badge (used in dashboard/settings) ─────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.user-email { color: var(--text-dim); }
.user-role {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-superadmin { background: rgba(229,72,77,0.15); color: #e5484d; }
.badge-view-only  { background: rgba(62,142,222,0.15); color: #3e8ede; }
.btn-logout {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.btn-logout:hover { background: rgba(229,72,77,0.1); color: #e5484d; border-color: rgba(229,72,77,0.3); }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .login-brand { display: none; }
  .login-wrapper { justify-content: center; }
  .login-form-panel { width: 100%; }
  html, body { overflow: auto; }
}
