/* ============================================================
   Clinic Management System — Login Page CSS
   Design: Matching hardware.mdrwebs.com color palette
   Theme: Deep Indigo / Purple-Navy | Primary: #6366f1
   ============================================================ */

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

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

/* -- CSS Variables (matching hardware.mdrwebs.com exactly) -- */
:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #818cf8;
  --primary-glow:   rgba(99, 102, 241, 0.30);
  --accent:         #f59e0b;
  --accent-dark:    #b45309;
  --success:        #10b981;
  --danger:         #ef4444;
  --text-main:      #f1f5f9;
  --text-muted:     #94a3b8;
  --glass-bg:       rgba(255, 255, 255, 0.055);
  --glass-border:   rgba(255, 255, 255, 0.11);
  --error:          #ef4444;
}

/* -- Body -- */
body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0718;
  color: var(--text-main);
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* -- Animated Background Scene -- */
#neuralCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(140deg, #0a0718 0%, #110d26 40%, #1c1640 70%, #0d0a20 100%);
  pointer-events: none;
  opacity: 1;
}

/* -- Gradient Overlay (orbs) -- */
.gradient-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Orb 1 — Indigo (top-left) */
.gradient-overlay::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  background: radial-gradient(circle, #4f46e5, #312e81);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  top: -180px; left: -140px;
  animation: driftOrb 11s ease-in-out infinite alternate;
}

/* Orb 2 — Amber (bottom-right) */
.gradient-overlay::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, #f59e0b, #b45309);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  bottom: -130px; right: -90px;
  animation: driftOrb 11s ease-in-out infinite alternate;
  animation-delay: 4s;
}

@keyframes driftOrb {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(22px,32px) scale(1.10); }
}

/* Grid pattern */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, .04) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* Particles */
.particle {
  position: fixed;
  background: rgba(255, 255, 255, .45);
  border-radius: 50%;
  animation: twinkle 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(1); }
  50%       { opacity: .85; transform: scale(2.2); }
}

/* -- Page Container -- */
.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* -- Login Card -- */
.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: clamp(28px,4vw,40px) clamp(24px,3vw,36px) clamp(22px,3vw,32px);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 32px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.1);
}

/* -- Login Header -- */
.login-header {
  text-align: center;
  margin-bottom: clamp(20px, 3vh, 28px);
}

/* -- Logo / Shield Icon -- */
.logo {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 28px rgba(99, 102, 241, .55);
  transition: transform 0.3s ease;
  font-size: 26px;
}

.logo svg {
  width: 32px; height: 32px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.3));
}

.logo:hover { transform: scale(1.08) rotate(4deg); }

/* -- Clinic Badge -- */
.clinic-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--primary-light);
}

.clinic-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.35);
  animation: blinkDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

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

.login-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(19px, 2.5vw, 23px);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
  letter-spacing: -0.3px;
}

.login-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0;
}

/* -- Network Status Badge -- */
#network-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  transition: all 0.4s ease;
}

/* -- Clinic Info Strip -- */
.clinic-info-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-item svg {
  width: 13px; height: 13px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* -- Login Body -- */
.login-body {
  /* inherits from card padding */
}

/* -- Form Groups -- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 7px;
}

/* -- Input Wrapper -- */
.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 .25s;
  z-index: 2;
}

.input-icon svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.form-control {
  width: 100%;
  height: 50px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 0 46px 0 42px;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.form-control::placeholder {
  color: rgba(148,163,184,.5);
}

.form-control:hover {
  border-color: rgba(99,102,241,0.3);
}

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

/* -- Password Toggle -- */
.toggle-password {
  position: absolute;
  right: 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color .25s;
  border-radius: 6px;
  z-index: 10;
}

.toggle-password svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-password:hover { color: var(--primary); }

/* Legacy emoji icon classes — blanked out, SVG takes over */
.icon-email::before, .icon-lock::before,
.icon-eye::before, .icon-eye-slash::before { content: ''; }

/* -- Remember / Forgot Row -- */
.remember-forgot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-wrapper label {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
}

.forgot-link {
  font-size: 12.5px;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}

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

/* -- Sign In Button -- */
.btn-login {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 8px 26px rgba(99,102,241,.5);
  position: relative;
  overflow: hidden;
}

/* Shimmer */
.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}

.btn-login:hover::before { left: 100%; }

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(99,102,241,.65);
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* -- Internet Error Banner -- */
#internet-error {
  display: none;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}

/* -- Validation Errors -- */
.text-danger {
  color: #fca5a5 !important;
  font-size: 11.5px;
  display: block;
  margin-top: 5px;
  font-weight: 500;
}

.alert.alert-danger {
  color: #fca5a5;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}

/* -- SSL / Secure note -- */
.location-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(148,163,184,.65);
  text-align: center;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.12);
  flex-wrap: wrap;
}

.location-notice strong,
.location-notice span[style*="bold"] {
  color: var(--success) !important;
  font-weight: 600;
  display: block;
  width: 100%;
  margin-bottom: 2px;
  font-size: 11.5px;
}

/* -- Register Link -- */
.register-link { display: none; }

/* -- Info Box (below card) -- */
.info-box {
  width: 100%;
  max-width: 460px;
  margin-top: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 18px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.info-row:last-child { margin-bottom: 0; }

.info-row svg {
  width: 13px; height: 13px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.info-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}

.info-row a:hover { color: #fbbf24; }

/* -- Footer -- */
.login-footer {
  width: 100%;
  max-width: 460px;
  text-align: center;
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(148,163,184,.5);
}

.login-footer p { margin: 0; }
.login-footer p span { color: var(--primary-light); font-weight: 600; }

/* -- Responsive -- */
@media (max-width: 520px) {
  body { padding: 16px 12px; align-items: flex-start; }
  .login-card {
    border-radius: 18px;
    padding: 22px 18px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
  }
  .logo { width: 52px; height: 52px; font-size: 20px; }
  .logo svg { width: 26px; height: 26px; }
  .login-header h1 { font-size: 18px; }
  .clinic-info-strip { gap: 12px; }
  .form-control { height: 48px; font-size: 16px; border-radius: 10px; }
  .btn-login { height: 50px; font-size: 14px; }
  .remember-forgot { flex-direction: column; gap: 10px; align-items: flex-start; }
  .info-box, .login-footer { max-width: 100%; }
}

/* -- PWA -- */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* -- Animations -- */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
