/* =============================================================
   Salary Portal — Custom Styles
   Fonts: Anek Kannada (headings) + Baloo Tamma 2 (body)
   Bootstrap 5.3 + Custom Theme
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Anek+Kannada:wght@300;400;500;600;700;800&family=Baloo+Tamma+2:wght@400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --primary:       #1a4f8a;
  --primary-dark:  #0f3460;
  --primary-light: #2d72c8;
  --accent:        #e8821a;
  --accent-light:  #f5a623;
  --success:       #198754;
  --surface:       #ffffff;
  --surface2:      #f4f7fb;
  --surface3:      #e8eef7;
  --border:        #d0dcea;
  --text:          #1a2640;
  --text-muted:    #5a6e8a;
  --text-light:    #8a9bbf;
  --shadow-sm:     0 2px 8px rgba(26,79,138,0.08);
  --shadow-md:     0 6px 24px rgba(26,79,138,0.13);
  --shadow-lg:     0 16px 48px rgba(26,79,138,0.18);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --transition:    0.22s cubic-bezier(.4,0,.2,1);
  --navbar-h:      70px;
}

/* ── Base Typography ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Baloo Tamma 2', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  background: var(--surface2);
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.heading-font {
  font-family: 'Anek Kannada', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary-dark);
}

/* ── Navbar ── */
#mainNavbar {
  height: var(--navbar-h);
  background: var(--primary-dark) !important;
  box-shadow: 0 2px 20px rgba(15,52,96,0.35);
  transition: box-shadow var(--transition);
  z-index: 1050;
}

#mainNavbar.scrolled {
  box-shadow: 0 4px 32px rgba(15,52,96,0.45);
}

.navbar-brand {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: 0.01em;
  gap: 0.5rem;
}

.navbar-brand .brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(232,130,26,0.4);
}

.navbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.navbar-brand .brand-sub {
  font-size: 0.6rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  font-family: 'Baloo Tamma 2', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Nav items */
.navbar-nav .nav-link {
  font-family: 'Baloo Tamma 2', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.82) !important;
  padding: 0.4rem 0.85rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}

/* Language toggle button */
#langToggle {
  font-family: 'Anek Kannada', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}

#langToggle:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.6);
}

/* Employee info pill */
.emp-pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emp-pill .emp-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #f5a623);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
}

.emp-pill .emp-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.emp-pill .emp-id {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  font-family: monospace;
}

/* ── Page Loader ── */
#pageLoader {
  position: fixed;
  inset: 0;
  background: rgba(10,28,60,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

#pageLoader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: loaderPop 0.3s ease;
}

@keyframes loaderPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.loader-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--surface3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1rem;
}

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

.loader-text {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Main Content Container ── */
#mainContent {
  min-height: calc(100vh - var(--navbar-h) - 80px);
  padding: 2rem 0 3rem;
  animation: contentFade 0.35s ease;
}

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

/* ── Cards ── */
.portal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.portal-card:hover { box-shadow: var(--shadow-md); }

.card-header-custom {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-header-custom .header-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}

.card-header-custom .header-title {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* ── Forms ── */
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  font-family: 'Baloo Tamma 2', sans-serif;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45,114,200,0.14);
  outline: none;
}

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

/* Input group icon */
.input-group-text {
  background: var(--surface3);
  border: 1.5px solid var(--border);
  color: var(--primary);
  font-size: 1rem;
}

/* ── Buttons ── */
.btn-portal-primary {
  font-family: 'Anek Kannada', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(26,79,138,0.25);
  cursor: pointer;
}

.btn-portal-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(26,79,138,0.38);
  color: #fff;
}

.btn-portal-accent {
  font-family: 'Anek Kannada', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(232,130,26,0.28);
  cursor: pointer;
}

.btn-portal-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,130,26,0.42);
  color: #fff;
}

.btn-portal-outline {
  font-family: 'Baloo Tamma 2', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-portal-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Login Page ── */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #1d5ca8 100%);
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,130,26,0.18) 0%, transparent 70%);
  top: -150px; right: -100px;
  pointer-events: none;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(45,114,200,0.25) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.login-brand-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 28px rgba(232,130,26,0.45);
  animation: iconFloat 3s ease-in-out infinite alternate;
}

@keyframes iconFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.login-brand-title {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.login-brand-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 340px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
}

.login-feature i { color: var(--accent-light); }

.login-form-panel {
  background: #fff;
  border-radius: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.5rem;
  box-shadow: -10px 0 60px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.login-form-title {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}

.login-form-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-family: monospace;
}

.pan-format-hint {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

/* ── Month Grid ── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.month-btn {
  background: var(--surface3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.4rem;
  text-align: center;
  font-family: 'Baloo Tamma 2', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}

.month-btn:hover:not(.disabled) {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(45,114,200,0.06);
  transform: translateY(-1px);
}

.month-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(26,79,138,0.3);
}

.month-btn.has-slip::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
}

.month-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Password Strength ── */
.strength-bar-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.4s;
  width: 0;
}

/* ── Requirements List ── */
.req-list { list-style: none; padding: 0; margin: 0; }
.req-item {
  font-size: 0.8rem;
  font-family: 'Baloo Tamma 2', sans-serif;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.18rem 0;
  transition: color 0.2s;
}
.req-item i { font-size: 0.75rem; transition: color 0.2s; }
.req-item.met { color: var(--success); }
.req-item.fail { color: #dc3545; }

/* ── PDF Viewer ── */
.pdf-viewer-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.pdf-toolbar {
  background: var(--primary-dark);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pdf-title {
  font-family: 'Anek Kannada', sans-serif;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.pdf-iframe {
  width: 100%;
  height: 700px;
  border: none;
  background: #f0f0f0;
  display: block;
}

/* ── Info Cards ── */
.info-chip {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.info-chip .chip-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 600;
}

.info-chip .chip-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Anek Kannada', sans-serif;
}

/* ── Alert Customization ── */
.alert-portal {
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Baloo Tamma 2', sans-serif;
  font-size: 0.88rem;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

/* ── Footer ── */
#mainFooter {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  padding: 1.25rem 0;
  margin-top: auto;
}

#mainFooter a { color: var(--accent-light); text-decoration: none; }
#mainFooter a:hover { color: #fff; }

/* ── Back to Top ── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: all var(--transition);
  pointer-events: none;
}

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#backToTop:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ── Welcome Banner ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '🏛';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 5rem;
  opacity: 0.08;
  pointer-events: none;
}

.welcome-banner h4 {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.25rem;
}

.welcome-banner p {
  color: rgba(255,255,255,0.72);
  font-size: 0.85rem;
  margin: 0;
}

/* ── FY Selector Tabs ── */
.fy-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fy-tab {
  font-family: 'Anek Kannada', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface3);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.fy-tab:hover:not(.active) {
  border-color: var(--primary-light);
  color: var(--primary);
}

.fy-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(26,79,138,0.25);
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; padding: 2rem 1.5rem; }
  .month-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 576px) {
  .month-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { padding: 1.2rem 1.25rem; }
  .welcome-banner::after { display: none; }
}

/* ── Utility ── */
.text-primary-portal { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-surface2 { background: var(--surface2) !important; }
.rounded-portal { border-radius: var(--radius) !important; }
.font-kn { font-family: 'Anek Kannada', sans-serif !important; }
.font-body { font-family: 'Baloo Tamma 2', sans-serif !important; }

/* Divider with label */
.divider-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0.5rem 0;
}

.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Toast */
.toast-portal {
  font-family: 'Baloo Tamma 2', sans-serif;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-md);
}
