/* main.css — shared styles, login page, base resets */

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

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

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --warning: #f9ab00;
  --warning-light: #fef7e0;
  --neutral: #5f6368;
  --neutral-light: #f1f3f4;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border: #dadce0;
  --border-light: #f1f3f4;
  --white: #ffffff;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --shadow-sm: 0 1px 2px rgba(60,64,67,0.12), 0 1px 3px rgba(60,64,67,0.08);
  --shadow-md: 0 2px 6px rgba(60,64,67,0.15), 0 1px 2px rgba(60,64,67,0.10);
  --shadow-lg: 0 4px 16px rgba(60,64,67,0.15), 0 2px 6px rgba(60,64,67,0.10);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

/* =====================
   LOGIN PAGE STYLES
   ===================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #f0f4fd;
}

/* Animated gradient background — subtle, professional */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 40%, #34a853 100%);
  opacity: 0.07;
  animation: gradientShift 8s ease-in-out infinite alternate;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,115,232,0.12) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: pulse 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%   { opacity: 0.05; transform: scale(1); }
  100% { opacity: 0.12; transform: scale(1.05); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.1); opacity: 1; }
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(218,220,224,0.6);
}

/* Bank brand header */
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-brand .brand-icon {
  width: 38px;
  height: 38px;
  color: var(--primary);
}

.login-brand .brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.login-brand .brand-name span {
  color: var(--text-primary);
}

.login-tagline {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* Form elements */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(217,48,37,0.08);
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 38px;
}

.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.input-toggle:hover {
  color: var(--text-secondary);
}

/* Login button */
.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: var(--transition);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(26,115,232,0.3);
  transform: translateY(-1px);
}

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

.btn-login.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Error message */
.error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* Demo hint */
.demo-hint {
  margin-top: 24px;
  padding: 12px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.demo-hint p {
  font-size: 12px;
  color: var(--primary-dark);
  line-height: 1.6;
}

.demo-hint strong {
  font-weight: 600;
}

/* Security footer */
.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

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

.divider span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =====================
   SHARED LAYOUT
   ===================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  background: #f7f9fc;
}

/* =====================
   SIDEBAR
   ===================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-logo .logo-text span {
  color: var(--text-primary);
}

/* Nav sections */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--neutral-light);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer — user profile */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.sidebar-logout:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* =====================
   TOPBAR
   ===================== */

.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-greeting {
  flex: 1;
}

.topbar-greeting h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-greeting p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--neutral-light);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* =====================
   MAIN CONTENT AREA
   ===================== */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  padding: 24px;
  flex: 1;
}

/* =====================
   UTILITY CLASSES
   ===================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-light);
  color: #b06000;
}

.badge-neutral {
  background: var(--neutral-light);
  color: var(--neutral);
}

.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* Generic card */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .login-card {
    padding: 32px 24px;
    margin: 16px;
  }
}
