/* iFraldas Design System — dark variant.
   Shared stylesheet for the php app hub (index.php) and the shared
   login screen (login.php).
   Iris teal primary, marguerite purple accent, Poppins body + Nunito
   headings, pill inputs/buttons, soft shadows, 16px cards. */

:root {
  /* Iris Blue (primary) */
  --if-iris: #01B6BC;
  --if-iris-600: #019296;
  --if-iris-700: #016D71;
  --if-iris-400: #80DBDD;

  /* Blue Marguerite (accent) — brightened for dark surfaces */
  --if-marguerite: #A5A0EC;

  /* Surfaces — slate scale, dark */
  --if-bg: #0B0B10;            /* slate-900 */
  --if-surface: #161621;       /* slate-800 */
  --if-raised: #201F31;        /* slate-700 */
  --if-border: #23233A;
  --if-border-strong: #2B2D42; /* slate-600 */

  /* Text */
  --if-text: #F7F8F9;
  --if-text-2: #ADADB4;        /* neutral-600 */
  --if-text-3: #828387;

  /* Error */
  --if-error: #FF395B;
  --if-error-300: #FFB0BD;

  /* Typography */
  --font-head: "Nunito", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Poppins", "Helvetica Neue", Arial, sans-serif;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);

  /* Card border — subtle iris tint */
  --if-card-border: rgba(1, 182, 188, 0.16);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--if-bg);
  color: var(--if-text);
  min-height: 100vh;
}

::selection { background: rgba(1, 182, 188, 0.25); }

button { font: inherit; cursor: pointer; }
input { font: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--if-iris);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Hub header                                                          */
/* ------------------------------------------------------------------ */

.lib-header {
  background: var(--if-surface);
  border-bottom: 1px solid var(--if-border);
}

.lib-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lib-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.lib-title .accent { color: var(--if-marguerite); }

.lib-logout {
  margin-left: auto;
  color: var(--if-text-2);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 9999px;
  transition: background 200ms ease, color 200ms ease;
}

.lib-logout:hover { background: var(--if-raised); color: var(--if-text); }

/* ------------------------------------------------------------------ */
/* Hub main + app cards                                                */
/* ------------------------------------------------------------------ */

.hub-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.hub-intro {
  color: var(--if-text-2);
  font-size: 14px;
  margin: 0 0 32px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--if-surface);
  border: 1px solid var(--if-card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--if-iris);
  box-shadow: var(--shadow-lg);
}

.app-icon { font-size: 2.4rem; line-height: 1; }

.app-name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 16px 0 6px;
}

.app-desc {
  color: var(--if-text-2);
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
  margin: 0 0 20px;
}

.app-open {
  align-self: flex-start;
  background: transparent;
  color: var(--if-iris);
  border: 1px solid var(--if-iris);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.app-card:hover .app-open {
  background: var(--if-iris);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

/* ------------------------------------------------------------------ */
/* Login screen                                                        */
/* ------------------------------------------------------------------ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  background: var(--if-surface);
  border: 1px solid var(--if-card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  padding: 40px 36px;
  width: min(360px, 100%);
  text-align: center;
}

.login-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 6px;
}

.login-title .accent { color: var(--if-marguerite); }

.login-sub {
  color: var(--if-text-2);
  font-size: 14px;
  margin: 0 0 20px;
}

.login-error {
  color: var(--if-error-300);
  background: rgba(255, 57, 91, 0.12);
  border-left: 3px solid var(--if-error);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  margin: 0 0 16px;
  text-align: left;
}

.login-input {
  width: 100%;
  height: 40px;
  padding: 12px 16px;
  font-size: 16px;
  background: var(--if-bg);
  color: var(--if-text);
  border: 1px solid var(--if-border-strong);
  border-radius: 9999px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.login-input::placeholder { color: var(--if-text-3); }
.login-input:hover { border-color: var(--if-text-3); }
.login-input:focus {
  border-color: var(--if-iris);
  outline: 2px solid var(--if-iris);
  outline-offset: 2px;
  box-shadow: var(--shadow-md);
}

.login-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--if-iris);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.login-btn:hover { background: var(--if-iris-600); box-shadow: var(--shadow-md); }
.login-btn:active { background: var(--if-iris-700); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .lib-header-inner { padding: 0 16px; }
  .hub-main { padding: 32px 16px 48px; }
  .login-card { padding: 32px 24px; }
}
