/* modhosts admin UI - follows the MOD (mod.es) visual identity. */

@font-face {
  font-family: "Power Grotesk";
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/PowerGrotesk-Light.woff2") format("woff2");
}
@font-face {
  font-family: "Power Grotesk";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/PowerGrotesk-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Power Grotesk";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/PowerGrotesk-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-latin.woff2") format("woff2");
}

:root {
  --mod-blue: #001c75;
  --mod-blue-600: #00196a;
  --mod-blue-dark: #000c31;
  --mod-blue-50: #f2f3fd;
  --mod-blue-extralight: #d8dbf9;
  --mod-blue-light: #808aed;
  --mod-blue-secondary: #005eff;
  --mod-green: #a7e252;
  --mod-purple: #af5cff;
  --mod-white: #fefefe;
  --mod-grey-text: #5c5c5c;
  --mod-error-bg: #ffeded;
  --mod-error-text: #661d1d;
  --mod-error-border: #ff4949;
  --mod-success-bg: #e7faf0;

  --font-heading: "Power Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --space: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--mod-blue);
  background: var(--mod-blue-50);
}

a { color: var(--mod-blue-secondary); }
a:hover { color: var(--mod-blue-600); }

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--mod-blue);
  margin: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  background: var(--mod-white);
  padding: 16px;
  box-shadow: 0 1px 0 var(--mod-blue-extralight);
}
.site-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand__logo { display: block; height: 44px; width: auto; }
.brand__name {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
  padding-left: 16px;
  border-left: 1px solid var(--mod-blue-extralight);
  color: var(--mod-blue);
}
.site-header form { margin: 0; }

/* Main */
main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* Cards */
.card {
  background: var(--mod-white);
  border-radius: 1rem;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 28, 117, 0.08), 0 4px 16px rgba(0, 28, 117, 0.06);
}
.card h2 { font-size: 22px; margin-bottom: 16px; }
.card--login { max-width: 380px; margin: 40px auto; }

/* Forms */
label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.hint { color: var(--mod-grey-text); font-size: 13px; font-weight: 400; }

input, select {
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  color: var(--mod-blue);
  background: var(--mod-white);
  border: 1px solid var(--mod-blue-extralight);
  border-radius: 0.5rem;
}
input::placeholder { color: var(--mod-grey-text); opacity: 0.7; }
input:focus, select:focus {
  outline: none;
  border-color: var(--mod-blue-secondary);
  box-shadow: 0 0 0 3px rgba(0, 94, 255, 0.25);
}
.card--login p { margin: 0 0 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.grid > * { min-width: 0; }
.grid__action { align-self: end; }

/* Wide screens: the whole create form (5 fields + button) fits on a single row. */
@media (min-width: 1100px) {
  .grid:has(.grid__action) {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.5fr) 110px 120px auto;
    align-items: end;
  }
  .grid:has(.grid__action) label { white-space: normal; }
}

/* Buttons: pills, uppercase, small */
button {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 24px;
  border-radius: 9999px;
  border: 1px solid var(--mod-blue);
  background: var(--mod-blue);
  color: var(--mod-white);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
button:hover { background: var(--mod-blue-600); border-color: var(--mod-blue-600); }
button:focus-visible {
  outline: 2px solid var(--mod-blue-secondary);
  outline-offset: 2px;
}
button.link {
  background: transparent;
  color: var(--mod-blue);
}
button.link:hover { background: var(--mod-blue); color: var(--mod-white); }
button.danger {
  background: transparent;
  color: var(--mod-error-text);
  border-color: var(--mod-error-border);
}
button.danger:hover {
  background: var(--mod-error-border);
  border-color: var(--mod-error-border);
  color: var(--mod-white);
}

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: 0.5rem;
  margin-bottom: 16px;
  border: 1px solid var(--mod-blue-extralight);
  border-left-width: 4px;
  background: var(--mod-white);
  color: var(--mod-blue);
  word-break: break-word;
}
.flash.error {
  background: var(--mod-error-bg);
  color: var(--mod-error-text);
  border-color: var(--mod-error-border);
}
.flash.success {
  background: var(--mod-success-bg);
  color: var(--mod-blue);
  border-color: var(--mod-green);
}
.flash.info { border-left-color: var(--mod-blue-light); }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--mod-blue-extralight);
  vertical-align: middle;
}
th {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mod-grey-text);
  white-space: nowrap;
}
tbody tr:hover { background: var(--mod-blue-50); }
td form { margin: 0; }
code { font-size: 13px; }
.expired { color: var(--mod-error-text); }

@media (min-width: 1024px) {
  .site-header { padding: 16px 40px; }
  main { padding-top: 48px; }
}

@media (max-width: 480px) {
  .site-header { padding: 12px; }
  .brand__logo { height: 36px; }
  .brand__name { font-size: 15px; padding-left: 8px; }
  .brand { gap: 8px; }
  .site-header button { padding: 6px 14px; font-size: 12px; white-space: nowrap; }
  .card { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .card--login { margin: 16px auto; }
}
