/*
 * SGW application styles
 * ----------------------
 * This file contains all custom styling used by the SGW web application.
 *
 * Organisation:
 *   1. Design tokens
 *   2. Base elements and layout
 *   3. Site header and language switcher
 *   4. Shared buttons, forms and alerts
 *   5. Login page
 *   6. Dashboard toolbar
 *   7. Dashboard content, uploads and accordions
 *   8. Compatibility utilities for existing Razor views
 *   9. Responsive styles
 *
 * Keep shared colours and measurements in :root so the appearance can be
 * adjusted consistently without searching through the whole stylesheet.
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --brand: #00866f;
  --brand-dark: #006e5b;
  --brand-soft: #e7f5f1;
  --ink: #243746;
  --muted: #637381;
  --line: #d9e2e8;
  --page: #f5f7f9;
  --surface: #fff;
  --blue: #1769e8;
  --danger: #d9364a;
  --warning: #f2bd35;
  --shadow: 0 10px 30px rgba(26, 45, 60, 0.08);
}
/* ==========================================================================
   2. Base elements and layout
   ========================================================================== */

*,
:before,
:after {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  font-size: 16px;
}
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.5;
}
a {
  color: var(--blue);
}
button,
input,
select {
  font: inherit;
}
.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
.site-main {
  min-height: calc(100vh - 111px);
}

/* ==========================================================================
   3. Site header and language switcher
   ========================================================================== */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 110px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.site-brand__logo {
  width: 105px;
  height: auto;
  flex: none;
}
.site-brand__text h1 {
  max-width: 720px;
  margin: 0;
  color: #354451;
  font-size: clamp(1.65rem, 2.3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.site-brand__text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.language-switcher {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  flex: none;
}
.language-switcher__link {
  padding: 7px 11px;
  color: #536573;
  border-radius: 5px;
  font-size: 0.85rem;
  text-decoration: none;
}
.language-switcher__link.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 5px rgba(23, 105, 232, 0.2);
}
.site-footer {
  height: 5px;
  background: linear-gradient(90deg, var(--brand), #5e809d);
}

/* ==========================================================================
   4. Shared buttons, forms and alerts
   ========================================================================== */
.btn {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:focus-visible,
.form-control:focus-visible,
.accordion-button:focus-visible,
.language-switcher__link:focus-visible {
  outline: 3px solid rgba(23, 105, 232, 0.25);
  outline-offset: 2px;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.875rem;
}
.btn-primary {
  color: #fff;
  background: var(--blue);
}
.btn-success {
  color: #fff;
  background: var(--brand);
}
.btn-success:hover {
  background: var(--brand-dark);
}
.btn-danger {
  color: #fff;
  background: var(--danger);
}
.btn-warning {
  color: #3c3100;
  background: var(--warning);
  border-color: #e2ab22;
}
.btn-info {
  color: #164653;
  background: #79d2e3;
  border-color: #61c4d8;
}
.btn-outline-primary {
  color: var(--blue);
  border-color: var(--blue);
  background: #fff;
}
.btn-outline-secondary {
  color: #526674;
  border-color: #aebbc5;
  background: #fff;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #415464;
  font-weight: 600;
}
.form-control {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9d4dc;
  border-radius: 7px;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 134, 111, 0.12);
  outline: 0;
}
.input-group {
  display: flex;
  width: 100%;
}
.input-group .form-control {
  min-width: 0;
  border-radius: 7px 0 0 7px;
}
.input-group .btn {
  border-radius: 0 7px 7px 0;
}
.alert {
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.alert-danger {
  color: #842029;
  background: #fbe8eb;
  border-color: #efc2c9;
}
.alert-info {
  color: #07576a;
  background: #e7f7fb;
  border-color: #bde8f1;
}
.alert-warning {
  color: #6b5100;
  background: #fff5cf;
  border-color: #f3d979;
}
.text-danger,
.field-validation-error {
  color: #c6283c;
  font-size: 0.88rem;
}

/* ==========================================================================
   5. Login page
   ========================================================================== */
.login-page {
  min-height: calc(100vh - 115px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 20px 64px;
  background: linear-gradient(180deg, #f8fafb 0, #eef3f6 100%);
}
.login-card {
  width: min(440px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(26, 45, 60, 0.09);
}
.login-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f3;
}
.login-card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 10px;
  font-size: 1.15rem;
}
.login-card__heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
}
.login-card__heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}
.login-form .form-group:last-of-type {
  margin-bottom: 20px;
}
.field-with-icon {
  position: relative;
}
.field-with-icon > i {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  color: #83939e;
}
.field-with-icon .form-control {
  padding-left: 39px;
}
.login-form__submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

/* ==========================================================================
   6. Dashboard toolbar
   ========================================================================== */
.dashboard-toolbar {
  padding: 22px 0;
  background: #eef3f6;
  border-bottom: 1px solid var(--line);
}
.dashboard-toolbar__inner {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 6px 20px rgba(26, 45, 60, 0.06);
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -6px;
}
.row > * {
  padding: 6px;
}
.col-12 {
  width: 100%;
}
.col-sm-2 {
  width: 16.6667%;
}
.col-sm-4 {
  width: 33.3333%;
}
.col-sm-6 {
  width: 50%;
}
.dashboard-toolbar__grid {
  align-items: center;
}
.dashboard-toolbar form {
  margin: 0;
}
.dashboard-toolbar .col-sm-4:nth-child(2) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dashboard-toolbar .col-sm-4:nth-child(2) .btn {
  width: 100%;
}
.dashboard-toolbar .btn {
  min-height: 42px;
}

/* ==========================================================================
   7. Dashboard content, uploads and accordions
   ========================================================================== */
.dashboard-section {
  padding: 26px 0 0;
}
.dashboard-section h2,
.dashboard-section h3 {
  margin: 0 0 12px;
  color: #29465f;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.dashboard-section h2 {
  font-size: 1.45rem;
}
.dashboard-section h3 {
  font-size: 1.35rem;
}
#uploadArea .container {
  display: block;
}
#uploadArea form {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(26, 45, 60, 0.05);
}
#uploadArea form .row {
  align-items: center;
}
#uploadArea input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  color: #475b69;
  background: #f9fbfc;
  border: 1px dashed #a8b8c3;
  border-radius: 7px;
}
#uploadArea input[type="file"]::file-selector-button {
  margin: -7px 12px -7px -10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand);
  border: 0;
  cursor: pointer;
}
#awd {
  width: 100% !important;
}
.dashboard-section--files {
  padding-bottom: 40px;
  background: #fff;
  border-top: 1px solid #edf1f3;
}
.dashboard-section--files > .container {
  padding-top: 4px;
}
.dashboard-section--files .alert-warning {
  margin-bottom: 16px;
}
.accordion {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(26, 45, 60, 0.04);
}
.accordion-item + .accordion-item {
  border-top: 1px solid var(--line);
}
.accordion-header,
.accordion-header .h5 {
  margin: 0;
}
.accordion-button {
  width: 100%;
  min-height: 58px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  color: #29465f;
  background: #fff;
  border: 0;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.accordion-button:hover {
  background: #f7fafb;
}
.accordion-button:after {
  width: 10px;
  height: 10px;
  margin-left: auto;
  content: "";
  border-right: 2px solid #536b7b;
  border-bottom: 2px solid #536b7b;
  transform: rotate(45deg);
  transition: transform 0.18s;
}
.accordion-button:not(.collapsed) {
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.accordion-button:not(.collapsed):after {
  transform: rotate(225deg);
}
.collapse:not(.show) {
  display: none;
}
.accordion-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 18px;
  background: #fbfcfd;
  border-top: 1px solid var(--line);
}
.btn-ffeil {
  color: #405767;
  background: #fff;
  border-color: #aebbc5;
}

/* ==========================================================================
   8. Compatibility utilities for existing Razor views

   These classes replace the small subset of Bootstrap utility, grid, table
   and pagination classes still referenced by the Razor views. Keep these
   until the views have been migrated to application-specific class names.
   ========================================================================== */
.d-flex {
  display: flex !important;
}
.justify-content-between {
  justify-content: space-between !important;
}
.align-items-center {
  align-items: center !important;
}
.gap-2 {
  gap: 0.5rem !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}
.mt-2 {
  margin-top: 0.5rem !important;
}
.me-2 {
  margin-right: 0.5rem !important;
}
.py-2 {
  padding-block: 0.5rem !important;
}
.greyBG {
  background: #eef3f6;
}
.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.table th,
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  color: #334c60;
  background: #eaf0f4;
}
.table-striped tbody tr:nth-child(odd) {
  background: #f8fafb;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 0;
  list-style: none;
}
.page-link {
  display: block;
  padding: 7px 11px;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}
.page-item.active .page-link {
  color: #fff;
  background: var(--blue);
}
#loggedInArea > #controlsArea > .container.greyBG {
  margin-block: 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

/* ==========================================================================
   9. Responsive styles
   ========================================================================== */

@media (max-width: 767px) {
  .site-header__inner {
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .site-brand {
    align-items: flex-start;
  }
  .site-brand__logo {
    width: 82px;
  }
  .site-brand__text h1 {
    font-size: 1.35rem;
  }
  .language-switcher {
    align-self: flex-end;
    margin-top: -4px;
  }
  .login-page {
    min-height: calc(100vh - 145px);
    padding: 22px 16px 40px;
  }
  .login-card {
    padding: 22px;
  }
  .col-sm-2,
  .col-sm-4,
  .col-sm-6 {
    width: 100%;
  }
  .dashboard-toolbar {
    padding: 14px 0;
  }
  .dashboard-toolbar__inner {
    padding: 12px;
  }
  .dashboard-toolbar .col-sm-4:nth-child(2) {
    grid-template-columns: 1fr;
  }
  .dashboard-section {
    padding-top: 20px;
  }
  #uploadArea form {
    padding: 12px;
  }
  .accordion-body {
    padding: 12px;
  }
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Password reset workflow
   ========================================================================== */
.login-form__help {
  margin: -4px 0 18px;
  text-align: right;
}

.login-form__help a,
.reset-card__back {
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.login-form__help a:hover,
.reset-card__back:hover {
  text-decoration: underline;
}

.reset-card__back {
  display: block;
  margin-top: 16px;
  text-align: center;
}

.reset-code {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.35rem;
  text-align: center;
}

.reset-card--success .login-card__icon {
  color: #157347;
  background: #e8f5ec;
}

/* ==========================================================================
   10. User administration views
   ========================================================================== */
.pennawd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
form .btn-primary,
.btn-danger {
  margin-top: 1rem;
}
