/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ==========================================================================
   Material Design 3 - design tokens
   Palette derived from the Hungr Geotech brand colors (#002145 / #558ed5).
   ========================================================================== */

:root {
  /* Color roles */
  --md-sys-color-primary: #0f3d75;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d6e3ff;
  --md-sys-color-on-primary-container: #001b3d;

  --md-sys-color-secondary: #558ed5;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #dce8ff;
  --md-sys-color-on-secondary-container: #0b2d55;

  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-success: #2e7d32;
  --md-sys-color-on-success: #ffffff;
  --md-sys-color-success-container: #d7f2d3;
  --md-sys-color-on-success-container: #052b0c;

  --md-sys-color-background: #f8f9fc;
  --md-sys-color-on-background: #1a1c1e;

  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #1a1c1e;
  --md-sys-color-surface-variant: #e1e2ec;
  --md-sys-color-on-surface-variant: #44474e;

  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f3f3fa;
  --md-sys-color-surface-container: #ededf6;
  --md-sys-color-surface-container-high: #e7e8f1;
  --md-sys-color-surface-container-highest: #e2e2eb;

  --md-sys-color-outline: #74777f;
  --md-sys-color-outline-variant: #c4c6d0;

  --md-sys-color-inverse-surface: #2f3033;
  --md-sys-color-inverse-on-surface: #f1f0f4;

  --md-sys-color-shadow: #000000;

  /* Shape */
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 999px;

  /* Elevation */
  --md-sys-elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-2: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-3: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15);

  /* Typography */
  --md-sys-typescale-font: "Roboto", "Segoe UI", Calibri, Arial, Helvetica, sans-serif;

  /* State layer opacities */
  --md-sys-state-hover-opacity: 0.08;
  --md-sys-state-focus-opacity: 0.12;
  --md-sys-state-pressed-opacity: 0.12;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-family: var(--md-sys-typescale-font);
}

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  padding: 0;
  padding-bottom: 56px; /* Footer height */
  background-color: var(--md-sys-color-background);
  font-family: var(--md-sys-typescale-font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--md-sys-color-on-background);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--md-sys-color-primary);
}

/* ==========================================================================
   Typography scale
   ========================================================================== */

h1 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 2rem; /* Headline Medium */
  line-height: 2.5rem;
  font-weight: 400;
  color: var(--md-sys-color-on-background);
}

h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.375rem; /* Title Large */
  line-height: 1.75rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

.font-weight-bold {
  font-weight: 500;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  clear: both;
  margin-left: auto;
  margin-right: auto;
  max-width: 1440px;
  padding: 24px 24px 40px;
  position: relative;
}

.md3-surface {
  background-color: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-1);
  padding: 24px;
}

.md3-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 20px 24px;
  max-width: 640px;
}

.md3-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.md3-toolbar--spaced {
  justify-content: space-between;
}

/* ==========================================================================
   Top app bar
   ========================================================================== */

header.md3-top-app-bar {
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--md-sys-elevation-1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header_logo {
  width: 220px;
  height: auto;
}

/* ==========================================================================
   Navigation tabs
   ========================================================================== */

nav.md3-tabs-wrapper {
  background-color: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md3-tabs {
  display: flex;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: auto;
  gap: 4px;
}

.md3-tabs a,
.md3-tabs .md3-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 16px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.md3-tabs a:hover {
  color: var(--md-sys-color-on-surface);
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.md3-tabs a.active {
  color: var(--md-sys-color-primary);
  border-bottom-color: var(--md-sys-color-primary);
  font-weight: 600;
}

.md3-tabs .md3-tabs__spacer {
  flex: 1 1 auto;
}

.md3-tabs .md3-tabs__account {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
  font-weight: 400;
  border-bottom: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.md3-button,
button,
input[type="submit"],
input[type="button"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-family: var(--md-sys-typescale-font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.md3-button::after,
button::after,
input[type="submit"]::after,
input[type="button"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: currentColor;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.md3-button:hover::after,
button:hover::after,
input[type="submit"]:hover::after,
input[type="button"]:hover::after {
  opacity: var(--md-sys-state-hover-opacity);
}

.md3-button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.md3-button:active::after,
button:active::after,
input[type="submit"]:active::after,
input[type="button"]:active::after {
  opacity: var(--md-sys-state-pressed-opacity);
}

/* Outlined button - secondary actions */
.md3-button--outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

/* Text button - low emphasis actions / navigation links */
.md3-button--text {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  padding: 0 12px;
}

/* Tonal button */
.md3-button--tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Destructive (error) button */
.md3-button--error {
  background-color: transparent;
  color: var(--md-sys-color-error);
  border: 1px solid var(--md-sys-color-error);
}

/* Rails' button_to wraps buttons in a form; keep the wrapper inline */
form.button_to {
  display: inline-block;
  margin: 0;
}

/* Icon button - used for row-level actions (show / edit / delete) */
.md3-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  background-color: transparent;
  padding: 0;
  border: none;
}

.md3-icon-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: currentColor;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.md3-icon-button:hover::after {
  opacity: var(--md-sys-state-hover-opacity);
}

.md3-icon-button:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.md3-icon-button--error {
  color: var(--md-sys-color-error);
}

/* ==========================================================================
   Forms
   ========================================================================== */

form {
  max-width: 480px;
}

div.actions {
  margin-top: 24px;
}

/* Outlined text field with floating label */
.md3-field {
  position: relative;
  margin-top: 20px;
}

.md3-field__input {
  width: 100%;
  height: 56px;
  padding: 16px;
  background-color: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: var(--md-sys-typescale-font);
  font-size: 1rem;
  color: var(--md-sys-color-on-surface);
}

.md3-field__input:focus {
  outline: none;
  border: 2px solid var(--md-sys-color-primary);
  padding: 15px;
}

.md3-field__label {
  position: absolute;
  left: 12px;
  top: 17px;
  padding: 0 4px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1rem;
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

.md3-field__input:focus ~ .md3-field__label,
.md3-field__input:not(:placeholder-shown) ~ .md3-field__label {
  top: -8px;
  font-size: 0.75rem;
}

.md3-field__input:focus ~ .md3-field__label {
  color: var(--md-sys-color-primary);
}

.md3-field--on-card .md3-field__label {
  background-color: var(--md-sys-color-surface-container-low);
}

/* Static-label field group (select, date, radio, checkbox) */
.md3-field-group {
  margin-top: 20px;
}

.md3-field-group > .md3-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.md3-field-group select,
.md3-field-group input[type="date"],
.md3-field-group input[type="number"] {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  background-color: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: var(--md-sys-typescale-font);
  font-size: 1rem;
  color: var(--md-sys-color-on-surface);
}

.md3-field-group select:focus,
.md3-field-group input[type="date"]:focus,
.md3-field-group input[type="number"]:focus {
  outline: none;
  border: 2px solid var(--md-sys-color-primary);
}

.md3-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.md3-radio-group label {
  font-size: 1rem;
  margin-left: 4px;
}

.md3-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

/* Devise helper text under a field */
.md3-supporting-text {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* ==========================================================================
   Banners / notices
   ========================================================================== */

.md3-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--md-sys-shape-corner-medium);
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.md3-banner:empty {
  display: none;
}

.md3-banner--success {
  background-color: var(--md-sys-color-success-container);
  color: var(--md-sys-color-on-success-container);
}

.md3-banner--error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.md3-error-list {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.md3-error-list h2 {
  color: var(--md-sys-color-on-error-container);
  font-size: 1rem;
  margin-bottom: 8px;
}

.md3-error-list ul {
  margin: 0;
  padding-left: 20px;
}

/* ==========================================================================
   Tables
   ========================================================================== */

table.md3-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-1);
}

.md3-table th {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md3-table td {
  padding: 12px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md3-table tbody tr:last-child td {
  border-bottom: none;
}

.md3-table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 5%, var(--md-sys-color-surface));
}

.md3-table td.align-left,
.md3-table th.align-left {
  text-align: left;
}

/* Key/value table used on show pages */
table.md3-details th {
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.875rem;
  width: 40%;
  vertical-align: top;
}

table.md3-details td {
  text-align: left;
}

/* ==========================================================================
   Status icons
   ========================================================================== */

svg.icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 20px;
  height: 20px;
}

svg.icon-green {
  color: var(--md-sys-color-success);
}

svg.icon-red {
  color: var(--md-sys-color-error);
}

/* ----- Icons sprite ----- */

div.svg-sprite {
  width: 0;
  height: 0;
  position: absolute;
  overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.md3-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  padding: 0 24px;
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
