/* =========================================================
   eBase — PREMIUM PORTAL
   YunoHost custom portal stylesheet
   ========================================================= */

:root {
  color-scheme: dark;

  --eb-bg: #080a12;
  --eb-panel: rgba(19, 22, 35, 0.76);
  --eb-panel-hover: rgba(29, 33, 51, 0.94);
  --eb-border: rgba(255, 255, 255, 0.085);
  --eb-border-hover: rgba(167, 139, 250, 0.42);

  --eb-text: #f5f5fb;
  --eb-muted: #999eb2;
  --eb-violet: #b5a0ff;
  --eb-teal: #77eadb;

  --eb-radius: 22px;
  --eb-shadow:
    0 24px 80px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* ---------- GLOBAL BACKGROUND ---------- */

html {
  min-height: 100%;
  background: var(--eb-bg);
}

body {
  min-height: 100vh;
  color: var(--eb-text);
  background:
    radial-gradient(
      ellipse at 12% 0%,
      rgba(109, 80, 190, 0.17),
      transparent 36rem
    ),
    radial-gradient(
      ellipse at 88% 20%,
      rgba(36, 155, 156, 0.105),
      transparent 32rem
    ),
    linear-gradient(145deg, #080a12 0%, #0c0f1b 55%, #090b13 100%);

  font-family:
    Inter, "SF Pro Display", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle background texture */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;

  background-image: radial-gradient(
    rgba(255, 255, 255, 0.19) 0.55px,
    transparent 0.55px
  );

  background-size: 5px 5px;
  mask-image: linear-gradient(
    to bottom,
    black,
    transparent 78%
  );
}

/* Keep portal content above background decoration */

body > *,
main,
#content,
.container {
  position: relative;
  z-index: 1;
}

::selection {
  color: #fff;
  background: rgba(139, 113, 230, 0.48);
}

/* ---------- TYPOGRAPHY ---------- */

h1, h2, h3, h4 {
  color: var(--eb-text);
  font-weight: 650;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.12;
}

p {
  color: var(--eb-muted);
  line-height: 1.8;
}

a {
  color: var(--eb-violet);
  text-decoration: none;
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

a:hover {
  color: var(--eb-teal);
}

/* ---------- HEADER / BRAND ---------- */

header,
nav,
.navbar {
  border-color: var(--eb-border);
}

#ynh-logo {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

header a,
nav a,
.navbar a {
  transition: color 180ms ease;
}

/* ---------- CUSTOM INTRO ---------- */

.ebase-hero {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;

  margin: 28px auto 34px;
  padding: clamp(28px, 5vw, 58px);

  max-width: 1120px;
  border: 1px solid var(--eb-border);
  border-radius: 28px;

  background:
    radial-gradient(
      ellipse at 100% 0%,
      rgba(145, 115, 255, 0.15),
      transparent 45%
    ),
    linear-gradient(
      135deg,
      rgba(24, 27, 44, 0.96),
      rgba(13, 17, 29, 0.89)
    );

  box-shadow: var(--eb-shadow);
}

.ebase-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 7%;
  right: 7%;
  height: 1px;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(190, 175, 255, 0.65),
    rgba(119, 234, 219, 0.35),
    transparent
  );
}

.ebase-kicker {
  display: inline-block;
  margin-bottom: 22px;

  color: var(--eb-violet);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.19em;
  line-height: 1.6;
  text-transform: uppercase;
}

.ebase-hero h2 {
  max-width: 800px;
  margin: 0 0 20px;

  color: #fbfaff;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  font-weight: 680;
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.ebase-lead {
  max-width: 650px;
  margin: 0;

  color: #c0c4d4;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.85;
}

.ebase-caption {
  max-width: 620px;
  margin-top: 18px;
  font-size: 0.9rem;
}

.ebase-meta {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-top: 30px;
  color: #b9c0d1;
  font-size: 0.83rem;
  letter-spacing: 0.015em;
}

.ebase-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;

  background: var(--eb-teal);
  box-shadow: 0 0 15px rgba(119, 234, 219, 0.65);
}

/* ---------- APP GRID ---------- */

#app-tiles {
  gap: 16px;
}

#app-tiles .app-tile,
.app-tile {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;

  border: 1px solid var(--eb-border);
  border-radius: var(--eb-radius);

  background:
    linear-gradient(
      145deg,
      rgba(24, 28, 44, 0.94),
      rgba(14, 17, 29, 0.9)
    );

  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);

  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

#app-tiles .app-tile::before,
.app-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background: radial-gradient(
    circle at 10% 0%,
    rgba(167, 139, 250, 0.09),
    transparent 60%
  );

  opacity: 0;
  transition: opacity 220ms ease;
}

#app-tiles .app-tile:hover,
.app-tile:hover {
  transform: translateY(-5px);

  border-color: var(--eb-border-hover);

  background:
    linear-gradient(
      145deg,
      rgba(31, 34, 54, 0.98),
      rgba(17, 21, 35, 0.97)
    );

  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(139, 113, 230, 0.055);
}

#app-tiles .app-tile:hover::before,
.app-tile:hover::before {
  opacity: 1;
}

.app-tile img,
#app-tiles .app-tile img {
  transition: transform 220ms ease;
}

.app-tile:hover img,
#app-tiles .app-tile:hover img {
  transform: scale(1.045);
}

.app-tile h2,
.app-tile h3,
.app-tile .app-tile-name {
  color: var(--eb-text);
  font-weight: 620;
  letter-spacing: -0.025em;
}

.app-tile p,
.app-tile .app-tile-description {
  color: var(--eb-muted);
  line-height: 1.65;
}

/* ---------- LOGIN / FORM PANELS ---------- */

form,
.panel,
.card {
  border-color: var(--eb-border);
}

input,
select,
textarea {
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;

  color: var(--eb-text);
  background: rgba(8, 11, 20, 0.76);

  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(167, 139, 250, 0.35);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(181, 160, 255, 0.8);

  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
  background: rgba(13, 16, 28, 0.96);
}

label {
  color: #d5d7e4;
  font-weight: 550;
}

/* ---------- BUTTONS ---------- */

button,
input[type="submit"],
.btn,
.button {
  border: 1px solid rgba(181, 160, 255, 0.24);
  border-radius: 12px;

  color: #fff;
  background: linear-gradient(
    135deg,
    #7661c9,
    #6453a9
  );

  font-weight: 650;
  letter-spacing: -0.01em;

  box-shadow: 0 5px 18px rgba(103, 82, 180, 0.18);

  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
}

button:hover,
input[type="submit"]:hover,
.btn:hover,
.button:hover {
  color: #fff;
  filter: brightness(1.12);
  transform: translateY(-1px);

  box-shadow: 0 9px 24px rgba(103, 82, 180, 0.25);
}

button:active,
.btn:active,
.button:active {
  transform: translateY(0);
}

/* ---------- SEPARATORS / FOOTER ---------- */

hr {
  border: 0;
  height: 1px;
  background: var(--eb-border);
}

footer {
  color: #747b91;
  border-color: var(--eb-border);
  font-size: 0.82rem;
}

/* ---------- ACCESSIBILITY ---------- */

:focus-visible {
  outline: 2px solid var(--eb-teal);
  outline-offset: 4px;
}

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

/* ---------- MOBILE ---------- */

@media (max-width: 640px) {
  .ebase-hero {
    margin: 16px 0 24px;
    padding: 28px 22px;
    border-radius: 22px;
  }

  .ebase-hero h2 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  #app-tiles {
    gap: 12px;
  }

  #app-tiles .app-tile,
  .app-tile {
    border-radius: 17px;
  }
}