/* ===== Banco Demo Nacional - Theme ===== */

:root {
  --primary: #1a365d;
  --primary-light: #2b6cb0;
  --accent: #3182ce;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #1a202c;
  --text-muted: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== DEMO Watermark ===== */
body::after {
  content: 'DEMO';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 12rem;
  font-weight: 900;
  color: rgba(229, 62, 62, 0.08);
  pointer-events: none;
  z-index: 9999;
  letter-spacing: 2rem;
}

/* ===== Header / Navbar ===== */
.navbar {
  background: var(--primary);
  color: white;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.navbar-brand .icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.demo-badge {
  background: var(--danger);
  color: white;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.navbar-user span { color: #cbd5e0; }

.btn-logout {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ===== Login Page ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: white;
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

.login-header .demo-badge {
  display: inline-block;
  margin-top: 0.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-light); }

.login-error {
  background: #fff5f5;
  color: var(--danger);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 1rem;
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Dashboard ===== */
.dashboard {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.account-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 16px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.25);
}

.account-info h2 { font-size: 1.1rem; font-weight: 400; opacity: 0.85; }
.account-info .account-number { font-size: 0.9rem; opacity: 0.7; margin-top: 0.25rem; }
.account-info .period { font-size: 0.85rem; opacity: 0.7; margin-top: 0.5rem; }

.account-balance .label { font-size: 0.85rem; opacity: 0.7; }
.account-balance .amount {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ===== Transaction Table ===== */
.table-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.table-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
}

.btn-export {
  background: var(--success);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-export:hover { background: #2f855a; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #edf2f7;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) { background: #f7fafc; }
tbody tr:hover { background: #edf2f7; }

.type-credito {
  color: var(--success);
  font-weight: 600;
}
.type-debito {
  color: var(--danger);
  font-weight: 600;
}

.amount-cell {
  font-family: 'Consolas', 'Courier New', monospace;
  font-weight: 600;
  text-align: right;
}

/* ===== Footer ===== */
.demo-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.demo-footer .warning {
  color: var(--danger);
  font-weight: 600;
}

/* ===== Animations ===== */

/* Spinner for loading buttons */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Button loading state */
.btn-loading {
  opacity: 0.85;
  cursor: wait !important;
  pointer-events: none;
}

.btn-primary.btn-loading {
  background: var(--primary-light);
}

.btn-export.btn-loading {
  background: #2f855a;
}

/* Button success state */
.btn-export.btn-success {
  background: var(--primary);
  cursor: default;
}

/* Table row staggered fade-in */
@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.row-animate {
  animation: rowFadeIn 0.35s ease forwards;
  opacity: 0;
}

/* Account summary slide-in */
.account-summary {
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table section fade-in */
.table-section {
  animation: fadeIn 0.8s ease-out 0.3s forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Login card entrance */
.login-card {
  animation: cardPop 0.5s ease-out;
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
