/* =================================================================
   AttendSync — Auth Pages CSS
   Modern glassmorphism / premium design
   ================================================================= */

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --primary:       #4f46e5;   /* indigo-600  */
  --primary-dark:  #3730a3;   /* indigo-800  */
  --primary-light: #6366f1;   /* indigo-500  */
  --secondary:     #7c3aed;   /* purple-600  */
  --secondary-dark:#5b21b6;   /* purple-800  */
  --accent:        #06b6d4;   /* cyan-500    */
  --accent-dark:   #0891b2;   /* cyan-600    */

  --success:       #10b981;
  --success-bg:    #ecfdf5;
  --success-border:#a7f3d0;
  --error:         #ef4444;
  --error-bg:      #fef2f2;
  --error-border:  #fecaca;

  --white:         #ffffff;
  --gray-50:       #f8fafc;
  --gray-100:      #f1f5f9;
  --gray-200:      #e2e8f0;
  --gray-300:      #cbd5e1;
  --gray-400:      #94a3b8;
  --gray-500:      #64748b;
  --gray-600:      #475569;
  --gray-700:      #334155;
  --gray-800:      #1e293b;
  --gray-900:      #0f172a;

  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 30px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:     0 25px 50px rgba(0,0,0,.12), 0 10px 20px rgba(0,0,0,.08);
  --shadow-primary:0 8px 24px rgba(79,70,229,.35);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Auth Wrapper ───────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* =================================================================
   LEFT PANEL
   ================================================================= */
.auth-left {
  min-width: 420px;
  width: 420px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 30%, var(--secondary-dark) 70%, var(--secondary) 100%);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: var(--white);
}

/* ── Floating Bubbles ───────────────────────────────────────────── */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: floatBubble linear infinite;
}

.bubble-1 {
  width: 180px;
  height: 180px;
  top: -60px;
  right: -40px;
  animation-duration: 8s;
  animation-delay: 0s;
  background: rgba(255,255,255,0.06);
}
.bubble-2 {
  width: 120px;
  height: 120px;
  top: 35%;
  right: -30px;
  animation-duration: 10s;
  animation-delay: -2s;
  background: rgba(255,255,255,0.05);
}
.bubble-3 {
  width: 90px;
  height: 90px;
  bottom: 80px;
  right: 30px;
  animation-duration: 7s;
  animation-delay: -4s;
  background: rgba(255,255,255,0.07);
}
.bubble-4 {
  width: 200px;
  height: 200px;
  bottom: -80px;
  left: -60px;
  animation-duration: 12s;
  animation-delay: -1s;
  background: rgba(255,255,255,0.04);
}
.bubble-5 {
  width: 60px;
  height: 60px;
  top: 20%;
  left: 20px;
  animation-duration: 9s;
  animation-delay: -3s;
  background: rgba(255,255,255,0.09);
}

@keyframes floatBubble {
  0%   { transform: translateY(0px) scale(1); }
  25%  { transform: translateY(-18px) scale(1.03); }
  50%  { transform: translateY(-10px) scale(0.98); }
  75%  { transform: translateY(-22px) scale(1.02); }
  100% { transform: translateY(0px) scale(1); }
}

/* ── Brand ──────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--white);
}

/* ── Hero Text ──────────────────────────────────────────────────── */
.left-hero {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--white);
}

.hero-accent {
  color: rgba(255,255,255,0.75);
  font-style: italic;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.70);
  font-weight: 400;
  line-height: 1.65;
  max-width: 300px;
}

/* ── Feature List ───────────────────────────────────────────────── */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--white);
  backdrop-filter: blur(4px);
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-text strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
}

.feature-text span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.62);
  line-height: 1.4;
}

/* ── Left Footer ────────────────────────────────────────────────── */
.left-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  position: relative;
  z-index: 1;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.left-footer i {
  font-size: 14px;
  color: var(--accent);
}

/* =================================================================
   RIGHT PANEL
   ================================================================= */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--gray-50);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(79,70,229,0.04) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(124,58,237,0.04) 0%, transparent 60%);
}

/* ── Auth Card ──────────────────────────────────────────────────── */
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  position: relative;
}

/* =================================================================
   AUTH FORM ELEMENTS
   ================================================================= */

/* ── Header ─────────────────────────────────────────────────────── */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-sm {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--white);
  margin-bottom: 20px;
  box-shadow: var(--shadow-primary);
}

.forgot-icon {
  background: linear-gradient(135deg, var(--accent-dark), var(--primary));
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 400;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-label i {
  color: var(--primary);
  margin-right: 4px;
  font-size: 11px;
}

/* ── Input Wrapper ──────────────────────────────────────────────── */
.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.10);
  background: #fdfcff;
}

.form-input:hover:not(:focus) {
  border-color: var(--gray-300);
}

/* Password toggle button inside input */
.input-has-icon .form-input {
  padding-right: 46px;
}

.input-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 15px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-btn:hover {
  color: var(--primary);
}

/* ── Form Row (remember me + forgot) ───────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 8px;
}

/* ── Custom Checkbox ────────────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 5px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  position: relative;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: 2px solid var(--white);
  border-top: none;
  border-left: none;
  transform: rotate(42deg) translate(-1px, -1px);
}

.checkbox-input:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

.checkbox-text {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* ── Links ──────────────────────────────────────────────────────── */
.link-muted {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.link-muted:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: var(--font);
  transition: color 0.18s ease;
}

.link-btn:hover {
  color: var(--primary-dark);
}

/* ── Primary Button ─────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--secondary) 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.4s ease, opacity 0.2s ease;
  box-shadow: var(--shadow-primary);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.015) translateY(-1px);
  box-shadow: 0 12px 30px rgba(79,70,229,0.40);
  background-position: 100% 50%;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.99) translateY(0);
  box-shadow: var(--shadow-primary);
}

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

.btn-text,
.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Alert Boxes ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
  line-height: 1.5;
  animation: fadeSlideIn 0.25s ease;
}

.alert i {
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-error {
  background: var(--error-bg);
  color: #b91c1c;
  border-color: var(--error-border);
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border-color: var(--success-border);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Security Note ──────────────────────────────────────────────── */
.auth-secure-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-secure-note i {
  color: var(--success);
  font-size: 13px;
}

/* ── Auth Footer Link ───────────────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.back-link:hover {
  color: var(--primary);
  background: rgba(79,70,229,0.06);
  border-color: rgba(79,70,229,0.2);
  transform: translateX(-2px);
}

/* ── Success State ──────────────────────────────────────────────── */
.success-state {
  text-align: center;
  padding: 8px 0;
  animation: fadeSlideIn 0.35s ease;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--success), #34d399);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--white);
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.30);
}

.success-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.success-body {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.65;
  margin-bottom: 16px;
}

.success-body strong {
  color: var(--gray-800);
}

.success-hint {
  font-size: 0.82rem;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  line-height: 1.55;
}

.success-hint i {
  color: var(--accent-dark);
  margin-top: 1px;
  flex-shrink: 0;
}

/* =================================================================
   RESPONSIVE — MOBILE
   ================================================================= */
@media (max-width: 900px) {
  .auth-left {
    display: none;
  }

  .auth-right {
    align-items: flex-start;
    padding: 32px 16px;
  }

  .auth-card {
    padding: 36px 28px;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
    box-shadow: var(--shadow-md);
  }

  .auth-title {
    font-size: 1.4rem;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* =================================================================
   SCROLLBAR (Webkit)
   ================================================================= */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
