* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f7fb;
  color: #172033;
}

/* LOGIN */
.login {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(120deg, #1e3a8a, #0f172a);
}

.login-box {
  width: 370px;
  background: white;
  padding: 35px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.8s ease;
}

.login-logo {
  width: 95px;
  margin-bottom: 10px;
}

.login-box h2 {
  margin: 5px 0;
  color: #1e3a8a;
}

.login-box p {
  color: #64748b;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
}

input:focus {
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

button {
  border: none;
  border-radius: 10px;
  background: #1e3a8a;
  color: white;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(30, 58, 138, 0.25);
}

.login-box button {
  width: 100%;
  margin-top: 8px;
}

.login-box small {
  display: block;
  margin-top: 15px;
  color: #94a3b8;
}

/* DASHBOARD */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: white;
  padding: 20px;
  box-shadow: 5px 0 20px rgba(0, 0, 0, 0.04);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 45px;
}

.brand h3 {
  color: #1e3a8a;
  font-size: 17px;
  margin: 0;
}

.profile {
  margin-top: 25px;
  background: #f8fafc;
  padding: 18px;
  border-radius: 16px;
  text-align: center;
}

.avatar {
  width: 54px;
  height: 54px;
  background: #1e3a8a;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  font-weight: bold;
  font-size: 22px;
}

.profile h4 {
  margin: 10px 0 4px;
  font-size: 14px;
}

.profile p {
  font-size: 12px;
  color: #64748b;
}

.profile span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 50px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 12px;
}

nav {
  margin-top: 30px;
}

nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #475569;
  margin-bottom: 6px;
  cursor: pointer;
  transition: 0.25s;
  text-decoration: none;
}

nav a:hover,
nav a.active {
  background: #1e3a8a;
  color: white;
  transform: translateX(5px);
}

.version {
  position: absolute;
  bottom: 20px;
  color: #94a3b8;
  font-size: 12px;
}

/* MAIN */
.main {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
}

/* PAGES */
.page {
  display: none;
  animation: fadeUp 0.45s ease;
}

.active-page {
  display: block;
}

/* BANNIÈRE */
.marquee-banner {
  width: 100%;
  background: #1e3a8a;
  color: red;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.18);
}

.marquee-banner span {
  display: inline-block;
  white-space: nowrap;
  padding: 12px 0;
  font-weight: 700;
  animation: marquee 14s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(110%);
  }

  100% {
    transform: translateX(-110%);
  }
}

/* TOPBAR */
.topbar {
  background: white;
  padding: 18px 24px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeUp 0.5s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.topbar h2 {
  margin: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: #64748b;
}

.top-balance {
  padding: 10px 18px;
  background: #1e3a8a;
  color: white;
  border-radius: 50px;
  font-weight: bold;
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  animation: cardIn 0.6s ease forwards;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  transition: 0.25s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

.stat-card p {
  margin: 0;
  color: #64748b;
}

.stat-card h3 {
  margin: 8px 0 0;
}

.green {
  background: linear-gradient(120deg, #1e3a8a, #60a5fa);
  color: white;
}

.green p {
  color: white;
}

.red {
  background: #fff1f2;
}

.purple {
  background: #faf5ff;
}

/* CONTENT */
.content {
  display: grid;
  grid-template-columns: 1.6fr 0.85fr;
  gap: 20px;
  margin-top: 20px;
}

.account-card {
  background: linear-gradient(120deg, #1e3a8a, #0f172a 70%);
  color: white;
  padding: 28px;
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.7s ease;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.account-header p,
.label {
  opacity: 0.8;
  margin: 0;
}

.account-card h1 {
  font-size: 38px;
  margin: 12px 0 25px;
}

.clock {
  font-size: 20px;
  font-weight: bold;
}

.account-info {
  background: rgba(255, 255, 255, 0.12);
  padding: 16px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-info p {
  margin: 0;
  opacity: 0.75;
}

.account-info h3 {
  margin: 5px 0 0;
}

.inactive {
  background: #fee2e2;
  color: #991b1b;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
}

.notice {
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.35);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

.action-card,
.panel {
  background: white;
  padding: 22px;
  border-radius: 16px;
  margin-top: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  animation: fadeUp 0.8s ease;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.actions button {
  flex: 1;
}

.panel {
  margin-top: 0;
  margin-bottom: 20px;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.panel-row span {
  width: 42px;
  height: 42px;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.panel-row p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.panel-row h4 {
  margin: 3px 0 0;
}

/* TRANSACTIONS */
.transaction-row {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #e5e7eb;
}

.transaction-row strong {
  color: #1e3a8a;
}

/* CARTE BANCAIRE PREMIUM */
.bank-card {
  width: 420px;
  min-height: 240px;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  color: white;
  border-radius: 24px;
  padding: 28px;
  margin-top: 25px;
  margin-bottom: 25px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-top p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.card-type {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
}

.bank-card h3 {
  margin: 35px 0 25px;
  font-size: 24px;
  letter-spacing: 3px;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.card-bottom p {
  margin: 0 0 5px;
  font-size: 11px;
  opacity: 0.7;
}

.card-bottom span {
  font-size: 13px;
  font-weight: 700;
}

.card-extra {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  opacity: 0.85;
}

.card-extra p {
  margin: 4px 0;
}

/* ALERTES */
.warning {
  color: #b45309;
  font-size: 13px;
  margin-top: 12px;
}

/* FOOTER */
footer {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 20px;
}

/* ANIMATIONS */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 1000px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
  }

  .version {
    position: static;
    margin-top: 20px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .bank-card {
    width: 100%;
  }
}

/* LOADER CENTRÉ */
.loader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(105, 108, 114, 0.527);
  backdrop-filter: blur(6px);

  z-index: 9999;
}

.loader-box {
  text-align: center;
  color: rgb(9, 19, 2);
  animation: fadeUp 0.4s ease;
}

.loader-box img {
  width: 80px;
  margin-bottom: 15px;
}

.spinner {
  margin: 20px auto 0;
  width: 45px;
  height: 45px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bank-card {
  animation: cardFloat 5s ease-in-out infinite;
}

@keyframes cardFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 35px rgba(0,0,0,0.12);
}

.page.active-page {
  animation: pageReveal 1ms ease both;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.inactive {
  animation: statusPulse 1.8s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(153,27,27,0);
  }
  50% {
    box-shadow: 0 0 12px rgba(153,27,27,0.35);
  }
}

.account-card {
  animation: accountFloat 5s ease-in-out infinite;
}

@keyframes accountFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ANIMATION PREMIUM CARTE COMPTE */
.account-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: accountFloat 5s ease-in-out infinite;
}

.account-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 28px 65px rgba(0,0,0,0.35);
}

.account-card::before {
  content: "";
  position: absolute;
  top: -80%;
  left: -80%;
  width: 70%;
  height: 250%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.25),
    transparent
  );
  transform: rotate(25deg);
  animation: accountShine 5s ease-in-out infinite;
  pointer-events: none;
}

.account-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -70px;
  right: -70px;
  background: rgba(96,165,250,0.28);
  filter: blur(60px);
  animation: accountGlow 6s ease-in-out infinite;
  pointer-events: none;
}

.account-card > * {
  position: relative;
  z-index: 2;
}

.account-card h1 {
  animation: amountPulse 2.8s ease-in-out infinite;
  transform-origin: left center;
}

@keyframes accountFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes accountShine {
  0% {
    left: -90%;
  }

  45% {
    left: 120%;
  }

  100% {
    left: 120%;
  }
}

@keyframes accountGlow {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }

  50% {
    transform: translate(-35px, 35px);
    opacity: 1;
  }
}

@keyframes amountPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.025);
  }
}