@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {

  /* Brand palette — matches codesphereapi.co.ke + the physical Lipa na Codesphere sticker */
  --navy-900: #0a2540;
  --navy-800: #0f2f52;
  --navy-700: #163d68;
  --navy-050: #eaf1fa;

  --mpesa-green: #00a651;
  --mpesa-green-dark: #00863f;

  --paper: #f6f8fb;
  --surface: #ffffff;
  --ink: #0b1220;
  --muted: #5b6b82;
  --line: #dde5ef;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-card: 0 1px 2px rgba(10, 37, 64, 0.06), 0 12px 32px -16px rgba(10, 37, 64, 0.18);
  --shadow-lift: 0 20px 60px -24px rgba(10, 37, 64, 0.35);

  --container: 1120px;

}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

img {
  max-width: 100%;
  display: block;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mpesa-green);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--mpesa-green);
  color: #ffffff;
  box-shadow: 0 10px 24px -10px rgba(0, 166, 81, 0.55);
}

.btn-primary:hover {
  background: var(--mpesa-green-dark);
  transform: translateY(-1px);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  background: var(--navy-900);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--navy-700);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-900);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--navy-700);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mpesa-green-dark);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mpesa-green);
}


/* =========================================================
   CODESPHERE PAYBILL — NOTIFICATIONS
   ========================================================= */

.app-notifications {
    position: fixed;

    left: 50%;
    bottom: 24px;

    transform: translateX(-50%);

    width: min(
        calc(100% - 32px),
        460px
    );

    display: flex;
    flex-direction: column;
    gap: 10px;

    z-index: 999999;

    pointer-events: none;
}


/* =========================================================
   NOTIFICATION
   ========================================================= */

.app-notification {
    position: relative;

    display: flex;
    align-items: center;

    gap: 13px;

    width: 100%;
    box-sizing: border-box;

    padding: 14px 15px;

    border: none;
    border-radius: 13px;

    color: #ffffff;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.18),
        0 4px 10px rgba(15, 23, 42, 0.08);

    opacity: 0;

    transform:
        translateY(25px)
        scale(0.97);

    transition:
        opacity 0.28s ease,
        transform 0.28s ease;

    pointer-events: auto;
}


.app-notification.show {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}


.app-notification.hide {
    opacity: 0;

    transform:
        translateY(18px)
        scale(0.97);
}


/* =========================================================
   ICON
   ========================================================= */

.app-notification-icon {

    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.18);

    color: #ffffff;
}


.app-notification-icon svg {

    width: 20px;
    height: 20px;

    stroke-width: 2.4;
}


/* =========================================================
   CONTENT
   ========================================================= */

.app-notification-content {
    flex: 1;

    min-width: 0;
}


.app-notification-message {

    font-size: 14px;

    line-height: 1.5;

    font-weight: 600;

    color: #ffffff;
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.app-notification-close {

    width: 32px;
    height: 32px;

    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;

    background: rgba(255, 255, 255, 0.12);

    color: #ffffff;

    border-radius: 8px;

    cursor: pointer;

    transition:
        background 0.2s ease;
}


.app-notification-close:hover {

    background: rgba(255, 255, 255, 0.22);
}


.app-notification-close svg {

    width: 16px;
    height: 16px;
}


/* =========================================================
   SUCCESS
   ========================================================= */

.app-notification-success {

    background: #16a34a;
}


/* =========================================================
   ERROR
   ========================================================= */

.app-notification-error {

    background: #dc2626;
}


/* =========================================================
   WARNING
   ========================================================= */

.app-notification-warning {

    background: #d97706;
}


/* =========================================================
   INFO
   ========================================================= */

.app-notification-info {

    background: #2563eb;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .app-notifications {

        width: calc(100% - 24px);

        bottom: 14px;
    }


    .app-notification {

        padding: 13px 12px;

        border-radius: 12px;
    }


    .app-notification-icon {

        width: 35px;
        height: 35px;

        min-width: 35px;
    }


    .app-notification-message {

        font-size: 13px;
    }
}

/* =========================================================
   PAGE SKELETON
   ========================================================= */

.page-skeleton {
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: #ffffff;
}


/*
 * =========================================================
 * PAGE SKELETON — shimmer loader shown before real content
 * =========================================================
 */

.page-skeleton {
  min-height: 100vh;
  background: var(--bg, #fff);
  padding: 32px clamp(20px, 5vw, 64px);
  opacity: 1;
  transition: opacity 0.22s ease;
}

.page-skeleton-out {
  opacity: 0;
}

/* Content fading in once the real page mounts */
.page-enter {
  animation: page-enter-anim 0.35s ease both;
}

@keyframes page-enter-anim {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
 * ---------------------------------------------------------
 * BRAND MARK
 * ---------------------------------------------------------
 */

.skel-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}

.skel-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-blue, #0a63ff);
  animation: skel-pulse 1.1s ease-in-out infinite;
}

.skel-brand-text {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--navy-800, #1f2b45);
  opacity: 0.55;
  animation: skel-pulse 1.6s ease-in-out infinite;
}

@keyframes skel-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}

/*
 * ---------------------------------------------------------
 * SHIMMER PRIMITIVES
 * ---------------------------------------------------------
 */

.skel {
  position: relative;
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    100deg,
    var(--brand-blue-050, #eef4ff) 20%,
    #ffffff 40%,
    var(--brand-blue-050, #eef4ff) 60%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.5s ease-in-out infinite;
  overflow: hidden;
}

@keyframes skel-shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

.skel-line {
  border-radius: 6px;
}

.skel-circle {
  border-radius: 50%;
  flex-shrink: 0;
}

.skel-block {
  border-radius: 14px;
}

/*
 * ---------------------------------------------------------
 * LAYOUT — shared containers
 * ---------------------------------------------------------
 */

.skel-page {
  max-width: 1180px;
  margin: 0 auto;
}

.skel-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.skel-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.skel-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .skel-grid-3,
  .skel-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .skel-grid-3,
  .skel-grid-4 {
    grid-template-columns: 1fr;
  }
}

/*
 * ---------------------------------------------------------
 * LANDING VARIANT
 * ---------------------------------------------------------
 */

.skel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.skel-nav-actions {
  display: flex;
  gap: 10px;
}

.skel-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.skel-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skel-hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 800px) {
  .skel-hero {
    grid-template-columns: 1fr;
  }
}

/*
 * ---------------------------------------------------------
 * AUTH VARIANT
 * ---------------------------------------------------------
 */

.skel-auth {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 0;
  min-height: 70vh;
}

.skel-auth-side {
  background: var(--brand-blue-050, #eef4ff);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skel-auth-side-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.skel-auth-main {
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skel-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.skel-auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skel-auth-submit {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .skel-auth {
    grid-template-columns: 1fr;
  }
  .skel-auth-main {
    padding: 32px 8px;
  }
}

/*
 * ---------------------------------------------------------
 * DASHBOARD VARIANT
 * ---------------------------------------------------------
 */

.skel-dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.skel-dash-table {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skel-dash-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line, #e6e9f0);
}