/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ============================================
   ISS Design Tokens
   Shared brand palette — matches the Keycloak login theme.
   Navy #1b2a4a primary + warm gold #996d13 accent.
   ============================================ */
:root {
  /* Brand colors */
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-text: #1a1f36;
  --color-muted: #5a6178;
  --color-border: #d1d5e0;
  --color-accent: #1b2a4a;
  --color-accent-hover: #0f1d38;
  --color-accent-light: #e8ecf4;
  --color-gold: #996d13;
  --color-gold-hover: #7a5710;
  --color-gold-light: #fdf6e8;
  --color-success: #1a7f37;
  --color-success-light: #f0fdf4;
  --color-danger: #d1242f;
  --color-danger-hover: #a81e25;
  --color-danger-light: #fef2f2;

  /* Typography */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Layout */
  --max-width: 64rem;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ============================================
   Base reset
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-gold-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================
   Shared button styles
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.2);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(27, 42, 74, 0.3);
}

.btn-gold {
  background: var(--color-gold);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(153, 109, 19, 0.25);
}

.btn-gold:hover {
  background: var(--color-gold-hover);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(153, 109, 19, 0.35);
}

/* ============================================
   Typography scale
   ============================================ */
h1, h2, h3, h4 {
  line-height: 1.3;
  color: var(--color-accent);
}

h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: var(--font-weight-bold); }
h3 { font-size: 1.125rem; font-weight: var(--font-weight-bold); }
h4 { font-size: 1rem; font-weight: var(--font-weight-semibold); }

@media (min-width: 600px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* ============================================
   Flash messages
   ============================================ */
.flash {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-lg);
  border: 1px solid;
}

.flash-notice {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: var(--color-success);
}

.flash-alert {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* ============================================
   Shared button variants
   ============================================ */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-danger);
  background: var(--color-surface);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  text-decoration: none;
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-danger:focus-visible {
  outline: 2px solid var(--color-danger);
  outline-offset: 2px;
}

/* ============================================
   Shared detail row (profile, admin)
   ============================================ */
.detail-row {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--spacing-xs);
}

.detail-row dd {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0;
}

@media (min-width: 600px) {
  .detail-row {
    flex-direction: row;
    align-items: baseline;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
  }

  .detail-row dt {
    flex: 0 0 8rem;
    margin-bottom: 0;
  }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}
