/* =====================================================
   e-Pouroshava — Login Page Styles
   Uses design tokens from admin.css (--primary, --gray-*, ...)
   ===================================================== */

@font-face {
  font-family: 'HindSiliguriLocal';
  font-style: normal;
  font-weight: 400;
  src: url('/assets/fonts/HindSiliguri-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'HindSiliguriLocal';
  font-style: normal;
  font-weight: 700;
  src: url('/assets/fonts/HindSiliguri-Bold.ttf') format('truetype');
}

html, body { height: 100%; }
body { display: flex; align-items: stretch; }

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

/* Brand Panel */
.brand-panel {
  flex: 0 0 45%;
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--primary) 50%, var(--bg-sidebar) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(96,165,250,0.12);
  animation: pulse-ring 4s ease-in-out infinite;
}
.ring-1 { width: 320px; height: 320px; top: 10%; left: -5%; animation-delay: 0s; }
.ring-2 { width: 240px; height: 240px; bottom: 10%; right: -3%; animation-delay: 1.3s; }
.ring-3 { width: 180px; height: 180px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 2.6s; }

@keyframes pulse-ring { 0%,100%{opacity:0.3;transform:scale(1)} 50%{opacity:0.7;transform:scale(1.06)} }
@keyframes spin { to{transform:rotate(360deg)} }

.brand-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 380px;
}

.brand-logo-wrap {
  width: 100px; height: 100px; margin: 0 auto 20px;
  background: rgba(255,255,255,0.08); border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.brand-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }

.brand-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 9999px;
  background: rgba(var(--success), 0.12); border: 1px solid rgba(var(--success), 0.25);
  margin-bottom: 16px; font-size: 12px; color: var(--success-light); font-weight: 500;
}
.brand-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

.brand-title {
  font-size: 28px; font-weight: 800; color: var(--text-inverse); margin: 0 0 8px;
}

.brand-divider {
  width: 60px; height: 3px; background: linear-gradient(90deg, var(--primary), #8b5cf6); border-radius: 2px; margin: 0 auto 16px;
}

.brand-subtitle {
  font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.7; margin: 0 0 28px;
}

.feature-cards {
  display: flex; flex-direction: column; gap: 12px;
}
.feature-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 500;
  transition: transform 0.2s, background 0.2s;
}
.feature-card:hover { transform: translateX(4px); background: rgba(255,255,255,0.07); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feature-icon svg { width: 20px; height: 20px; }
.fi-1 { background: rgba(var(--primary), 0.15); color: var(--primary-light); }
.fi-2 { background: rgba(var(--success), 0.15); color: var(--success-light); }
.fi-3 { background: rgba(var(--warning), 0.15); color: var(--warning-light); }

/* Form Panel */
.form-panel {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--bg-page);
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 40px 36px 32px;
  animation: slideUp 0.4s ease-out;
}
@keyframes slideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* admin.css makes .card-header a flex row (title left, actions right); on the
   sign-in card the title and the subtitle belong on their own lines. */
.login-card .card-header {
  display: block; padding: 0 0 14px; border-bottom: none; text-align: left;
}
.login-card .card-header h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); margin: 0 0 14px; line-height: 1.35; }
.login-card .card-header p { font-size: 14px; color: var(--gray-500); margin: 0; line-height: 1.6; }

.error-box {
  display: none; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--danger-light); border: 1px solid #fecaca; border-radius: 10px;
  color: var(--danger); font-size: 13px; font-weight: 500; margin-bottom: 16px;
  animation: shake 0.3s ease-in-out;
}
.error-box.show { display: flex; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.field { margin-bottom: 20px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }

.input-wrap {
  position: relative; display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s; background: var(--bg-card);
}
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }

.input-wrap input {
  flex: 1; padding: 12px 14px 12px 42px; border: none; outline: none;
  font-family: var(--font); font-size: 14px; color: var(--gray-900); background: transparent;
}
.input-wrap input::placeholder { color: var(--gray-400); }

.input-wrap .ico {
  position: absolute; left: 14px; color: var(--gray-400); pointer-events: none;
  transition: color 0.2s;
}
.input-wrap:focus-within .ico { color: var(--primary); }

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

.form-extras {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 13px;
}
.remember { display: flex; align-items: center; gap: 6px; color: var(--gray-600); cursor: pointer; }
.remember input[type=checkbox] { accent-color: var(--primary); }
.forgot { color: var(--primary); font-weight: 500; }
.forgot:hover { text-decoration: underline; }

.btn-submit {
  width: 100%; padding: 13px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #7c3aed); color: var(--text-inverse);
  font-family: var(--font); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,0.35); }
.btn-submit:active { transform: translateY(0); }
.btn-submit .loading { display: none; align-items: center; gap: 8px; }
.btn-submit.is-loading .content { display: none; }
.btn-submit.is-loading .loading { display: flex; }

.card-footer {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light);
  text-align: center; font-size: 12px; color: var(--gray-500);
}
.card-footer p { margin: 4px 0; }
.card-footer a { color: var(--primary); font-weight: 600; }
.copy { font-size: 11px; color: var(--gray-400); margin-top: 8px !important; }

/* Responsive Login — the brand panel becomes a compact gradient hero on
   phones (it used to be hidden, which made the page look plain). */
@media (max-width: 768px) {
  body { display: block; }
  .split { display: block; min-height: 100vh; background: var(--bg-page); }

  .brand-panel {
    display: flex; flex: none; min-height: 0;
    padding: 34px 22px 54px;
    border-bottom-left-radius: 28px; border-bottom-right-radius: 28px;
  }
  .brand-content { max-width: 100%; }
  .ring-1 { width: 200px; height: 200px; top: -80px; left: -70px; }
  .ring-2 { width: 150px; height: 150px; bottom: -55px; right: -55px; }
  .ring-3 { width: 130px; height: 130px; top: 36%; left: 78%; }
  .brand-logo-wrap { width: 80px; height: 80px; border-radius: 22px; padding: 13px; margin-bottom: 14px; }
  .brand-title { font-size: 22px; }
  .brand-badge { margin-bottom: 12px; padding: 5px 14px; font-size: 11px; }
  .brand-divider { margin-bottom: 12px; }
  .brand-subtitle, .feature-cards { display: none; }

  .form-panel { display: block; padding: 0 16px 40px; background: transparent; }
  .login-card {
    max-width: 100%; margin: -36px auto 0; position: relative; z-index: 3;
    padding: 26px 20px 22px; border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
  }
  .login-card .card-header { padding-bottom: 18px; }
  .login-card .card-header h1 { font-size: 19px; }
  .login-card .card-header p { font-size: 13px; }
  .btn-submit { padding: 14px; }
  .card-footer { margin-top: 22px; padding-top: 16px; }
}

@media (min-width: 769px) and (max-height: 650px) {
  .feature-cards { display: none; }
  .brand-logo-wrap { width: 72px; height: 72px; }
  .brand-title { font-size: 22px; }
  .brand-badge { display: none; }
  .brand-subtitle { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ring, .brand-logo-wrap, .brand-badge .dot, .login-card, .feature-card {
    animation: none !important;
    transition: none !important;
  }
  .feature-card:hover { transform: none; }
}

/* Focus visible for keyboard navigation */
.btn-submit:focus-visible,
.forgot:focus-visible,
.pwd-toggle:focus-visible,
.input-wrap input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.error-box:focus-visible { outline: 3px solid var(--danger); outline-offset: 2px; }

/* Brand scrollbar (auth pages have no admin-addendum, so they need their
   own copy): thin indigo thumb on a light track. */
html { scrollbar-width: thin; scrollbar-color: #4F46E5 #E8EBF0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #E8EBF0; border-radius: 8px; }
::-webkit-scrollbar-thumb { background: #4F46E5; border-radius: 8px; border: 2px solid #E8EBF0; }
::-webkit-scrollbar-thumb:hover { background: #4338CA; }