html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Shared public catalogue design */
:root {
  --np-indigo: #5b4df7;
  --np-indigo-dark: #4438d8;
  --np-ink: #17233c;
  --np-muted: #64748b;
  --np-surface: #ffffff;
  --np-soft: #f5f7fc;
  --np-border: #e8ebf4;
}

body {
  margin-bottom: 0;
  background: var(--np-soft) !important;
  color: var(--np-ink);
}

.container-fluid > main.container {
  max-width: 1120px;
  padding-top: .35rem;
}

/* The layout's original homepage navigation left a large gap before catalogue pages. */
.navbar.navbar-custom { margin-bottom: 14px; }

.container-fluid > main.container h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--np-ink);
}

.breadcrumb {
  padding: .7rem 0;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--np-muted);
  font-size: .84rem;
  text-decoration: none;
}

.breadcrumb-item a:hover { color: var(--np-indigo); }

.container-fluid > main.container .form-control,
.container-fluid > main.container .form-select {
  min-height: 46px;
  border: 1px solid var(--np-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.container-fluid > main.container .form-control:focus,
.container-fluid > main.container .form-select:focus {
  border-color: var(--np-indigo);
  box-shadow: 0 0 0 .2rem rgba(91, 77, 247, .12);
}

.container-fluid > main.container .btn-primary {
  background: linear-gradient(135deg, var(--np-indigo), #796cf8);
  border: 0;
  border-radius: 11px;
  font-weight: 600;
  padding-inline: 1.15rem;
}

.np-app-card {
  overflow: hidden;
  height: 100%;
  padding: 12px;
  border: 1px solid rgba(229, 232, 241, .9);
  border-radius: 22px;
  background: var(--np-surface);
  box-shadow: 0 10px 28px rgba(26, 37, 67, .055);
  transition: transform .22s ease, box-shadow .22s ease;
}

.np-app-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(56, 49, 150, .13);
}

.np-app-image {
  display: grid;
  place-items: center;
  height: 190px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #f6f7ff, #eef0fa);
}

.np-app-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.np-app-card-body { padding: 15px 4px 2px; }
.np-app-card-title { margin: 0 0 .35rem; font-size: 1.1rem; font-weight: 700; color: var(--np-ink); }
.np-app-rating { color: #e69a11; font-size: .82rem; font-weight: 600; }
.np-app-rating span, .np-app-version { color: var(--np-muted); font-weight: 400; }
.np-app-version { margin-bottom: .8rem; font-size: .78rem; }
.np-app-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; min-height: 3.9em; color: #526078; font-size: .82rem; line-height: 1.55; }
.np-app-actions { margin-top: .8rem; }

.np-details-button,
.np-download-button {
  display: block;
  border-radius: 10px;
  padding: .6rem .75rem;
  font-size: .84rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all .2s ease;
}

.np-details-button { border: 1px solid #cfcaff; color: var(--np-indigo); background: #fafaff; }
.np-details-button:hover { border-color: var(--np-indigo); color: var(--np-indigo-dark); background: #f2f0ff; }
/* Keep catalogue downloads consistent with the homepage card button. */
.np-download-button {
  color: #fff !important;
  background: #6c63ff;
  box-shadow: none;
  font-weight: 400;
  padding: 8px 20px;
}
.np-download-button:hover { color: #fff !important; background: #5a52ea; transform: none; }

.container-fluid > main.container > article.card,
.container-fluid > main.container .row > .col > article.card,
.container-fluid > main.container form.card {
  border: 1px solid var(--np-border) !important;
  border-radius: 22px !important;
  box-shadow: 0 12px 32px rgba(26, 37, 67, .06) !important;
}

.container-fluid > main.container .card-body { padding: 1.6rem; }
.container-fluid > main.container h2 { color: var(--np-ink); font-weight: 700; }
.container-fluid > main.container a { color: var(--np-indigo); }

footer.bg-white {
  border: 0 !important;
  background: #fff !important;
  box-shadow: 0 -8px 30px rgba(26, 37, 67, .04);
}

footer.bg-white h2 { color: var(--np-ink); font-weight: 700; }
footer.bg-white li { margin: .45rem 0; }
footer.bg-white a { color: var(--np-indigo); text-decoration: none; font-weight: 500; }
footer.bg-white a:hover { color: var(--np-indigo-dark); text-decoration: underline; }

/* Compact internal-link cards on app detail pages. */
.np-discovery-card {
  overflow: hidden;
  border: 1px solid var(--np-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 37, 67, .045);
}

.np-discovery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--np-border);
  color: var(--np-ink);
  text-decoration: none;
  transition: background .18s ease, padding .18s ease;
}

.np-discovery-item:last-child { border-bottom: 0; }
.np-discovery-item:hover { padding-left: 17px; background: #f7f6ff; color: var(--np-ink); }
.np-discovery-item img { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 11px; object-fit: cover; background: #f1f3f9; }
.np-discovery-copy { display: grid; min-width: 0; gap: 2px; }
.np-discovery-copy strong { overflow: hidden; color: var(--np-ink); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.np-discovery-copy small { color: var(--np-muted); font-size: .75rem; }
.np-discovery-arrow { margin-left: auto; color: var(--np-indigo); font-size: 1.5rem; line-height: 1; }

/* Blog pages use the same elevated NextPlay card system as the app catalogue. */
.np-blog-page { max-width: 1120px; padding-top: 1rem; }
.np-blog-hero { max-width: 720px; margin: .75rem 0 2rem; }
.np-blog-hero > span { color: var(--np-indigo); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.np-blog-hero h1 { margin: .35rem 0 .7rem; color: var(--np-ink); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.045em; }
.np-blog-hero p { color: var(--np-muted); font-size: 1rem; line-height: 1.7; }
.np-blog-card { height: 100%; overflow: hidden; border: 1px solid var(--np-border); border-radius: 22px; background: #fff; box-shadow: 0 10px 28px rgba(26,37,67,.055); transition: transform .2s ease, box-shadow .2s ease; }
.np-blog-card:hover { transform: translateY(-5px); box-shadow: 0 18px 36px rgba(56,49,150,.12); }
.np-blog-image { height: 190px; overflow: hidden; background: #f1f3fb; }
.np-blog-image img { width: 100%; height: 100%; object-fit: cover; }
.np-blog-image--fallback { height: 150px; display: grid; place-items: center; padding: 18px; background: linear-gradient(135deg, #eef3ff, #faf8ff); }
.np-blog-image--fallback img { width: min(150px, 68%); height: 100px; object-fit: contain; }
.np-blog-card-body { display: flex; flex-direction: column; min-height: 220px; padding: 1.35rem; }
.np-blog-meta { margin: 0 0 .55rem; color: var(--np-muted); font-size: .78rem; }
.np-blog-card h2 { margin: 0 0 .65rem; font-size: 1.12rem; line-height: 1.4; }
.np-blog-card h2 a { color: var(--np-ink); text-decoration: none; }
.np-blog-card h2 a:hover { color: var(--np-indigo); }
.np-blog-card-body > p:not(.np-blog-meta) { color: var(--np-muted); font-size: .88rem; line-height: 1.6; }
.np-blog-link { margin-top: auto; color: var(--np-indigo); font-size: .86rem; font-weight: 700; text-decoration: none; }
.np-blog-link span { margin-left: .25rem; transition: margin .2s ease; }.np-blog-link:hover span { margin-left: .5rem; }
.np-blog-empty { padding: 2.5rem; border: 1px dashed #cfcaff; border-radius: 20px; background: #fbfbff; color: var(--np-muted); text-align: center; }
@media (max-width: 768px) { .np-blog-hero { margin-top: .35rem; margin-bottom: 1.35rem; } .np-blog-image { height: 165px; } .np-blog-image--fallback { height: 130px; padding: 14px; } .np-blog-image--fallback img { height: 86px; } }

@media (max-width: 768px) {
  .container-fluid { padding-left: 1rem !important; padding-right: 1rem !important; }
  .navbar.navbar-custom { margin-top: 12px; margin-bottom: 4px; }
  .container-fluid > main.container { padding-top: 0; }
  .breadcrumb { padding-top: .35rem; padding-bottom: .35rem; }
  .np-app-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
  }
  .np-app-image {
    width: 112px;
    height: 112px;
    border-radius: 14px;
    align-self: start;
  }
  .np-app-image img { padding: 6px; }
  .np-app-card-body { min-width: 0; padding: 1px 0 0; }
  .np-app-card-title { font-size: 1rem; }
  .np-app-rating, .np-app-version { margin-bottom: .35rem; }
  .np-app-description { min-height: 0; margin-bottom: .55rem; -webkit-line-clamp: 2; }
  .np-app-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .np-details-button, .np-download-button { padding: .52rem .3rem; font-size: .75rem; white-space: nowrap; }
  .container-fluid > main.container h1 { font-size: 2rem; }
}
