/* ==========================================================================
   2G ENERGY RENTAL — Component Library
   Requires tokens.css to be loaded first.
   Framework-free: plain CSS, no build step, no dependencies.
   ========================================================================== */

/* ---- Base -------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  color: var(--gray-80);
  background: var(--white);
  line-height: var(--leading-normal);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ---- Headline underline device ------------------------------------------
   2G H1 headlines sit above a green underscore bar ~90% of the text width,
   just under the text.
------------------------------------------------------------------------- */

.headline-underline {
  display: inline-block;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  color: var(--2g-green);
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  position: relative;
}

.headline-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 90%;
  height: 4px;
  background: var(--2g-green);
  border-radius: var(--radius-sm);
}

.headline-underline--sm {
  font-size: var(--text-h3);
}

/* ---- Section header / eyebrow ------------------------------------------- */

.section-header {
  margin-bottom: var(--space-xl);
}

.eyebrow {
  display: block;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-60);
  margin-bottom: var(--space-xs);
}

/* ---- Tagline lockup ------------------------------------------------------
   "Rapid. Reliable. Rental." — rental brand signature.
------------------------------------------------------------------------- */

.tagline {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  color: var(--2g-green);
  font-size: var(--text-small);
  letter-spacing: 0.02em;
  margin: 0;
}

/* ---- Buttons -------------------------------------------------------------
   Primary (solid green), Secondary (green outline), Disabled.
   No bright-accent button — accent stays a soft tint, never a CTA color.
------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-body);
  line-height: 1;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--2g-green);
  color: var(--white);
}

.btn-primary:hover {
  background: #0f4f18; /* darkened 2G Green, hover only */
}

.btn-primary:active {
  background: #0c3f13; /* darkened 2G Green, active only */
}

.btn-secondary {
  background: transparent;
  color: var(--2g-green);
  border-color: var(--2g-green);
}

.btn-secondary:hover {
  background: var(--light-green);
}

.btn-secondary:active {
  background: #a8f0c4; /* darkened light-green, active only */
}

.btn-disabled,
.btn:disabled {
  background: var(--gray-10);
  color: var(--gray-40);
  border-color: var(--gray-10);
  cursor: not-allowed;
}

/* ---- Cards ---------------------------------------------------------------- */

.card {
  background: var(--white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-h4);
  color: var(--gray-80);
  margin: 0 0 var(--space-sm);
}

.card-body {
  font-size: var(--text-body);
  color: var(--gray-80);
  margin: 0;
}

/* Stat / metric card */

.card-stat {
  background: var(--gray-10);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.card-stat__number {
  display: block;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-h1);
  color: var(--2g-green);
  line-height: var(--leading-tight);
}

.card-stat__label {
  display: block;
  font-size: var(--text-small);
  color: var(--gray-60);
  margin-top: var(--space-xs);
}

/* ---- Badges / status pills -------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3em 0.8em;
  border-radius: var(--radius-pill);
}

.badge::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
}

.badge-active {
  background: #e2f2e4;
  color: var(--color-success);
}

.badge-pending {
  background: #fff6de;
  color: #8a6a00;
}

.badge-at-risk {
  background: #fbdbe1;
  color: var(--color-danger);
}

/* ---- Form inputs -------------------------------------------------------------- */

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.field-label {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-small);
  color: var(--gray-80);
}

.text-input,
.select-input {
  font-family: var(--font-family);
  font-size: var(--text-body);
  color: var(--gray-80);
  background: var(--white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  width: 100%;
}

.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--2g-green);
  box-shadow: 0 0 0 3px var(--light-green);
}

.select-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gray-60) 50%),
    linear-gradient(135deg, var(--gray-60) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---- Data table ------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-family);
  font-size: var(--text-body);
}

.table th {
  text-align: left;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-60);
  background: var(--gray-10);
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--border-color);
}

.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--gray-10);
  color: var(--gray-80);
}

.table tbody tr:hover {
  background: var(--light-green);
}

/* ---- Nav / header bar -------------------------------------------------------- */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border-bottom: var(--border-width) solid var(--border-color);
}

.navbar__logo {
  height: 32px;
  width: auto;
  display: block;
}

.navbar__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar__links a {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-small);
  color: var(--gray-80);
  text-decoration: none;
}

.navbar__links a:hover {
  color: var(--2g-green);
}

/* ---- Line icon example --------------------------------------------------------
   2G uses minimalist line icons with light-green fills. This is one example
   block, not a full icon set — build additional icons in the same style.
------------------------------------------------------------------------- */

.icon-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--light-green);
}

.icon-line svg {
  width: 24px;
  height: 24px;
  stroke: var(--2g-green);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Product card (rental unit spec card) --------------------------------------- */

.product-card {
  background: var(--white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.product-card__photo-panel {
  background: var(--light-green);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.product-card__photo-panel img {
  max-width: 100%;
  height: auto;
  display: block;
}

.product-card__body {
  padding: var(--space-lg);
}

.product-card__model {
  /* reuses .headline-underline sizing but scoped smaller for card context */
  display: inline-block;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  color: var(--2g-green);
  font-size: var(--text-h3);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  position: relative;
}

.product-card__model::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 90%;
  height: 3px;
  background: var(--2g-green);
  border-radius: var(--radius-sm);
}

.product-card__power-line {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-body);
  color: var(--gray-80);
  margin: 0 0 var(--space-lg);
}

.product-card__specs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
}

.product-card__specs th {
  text-align: left;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-small);
  color: var(--gray-80);
  padding: 0.4rem 0;
  border-bottom: var(--border-width) solid var(--gray-10);
  white-space: nowrap;
  vertical-align: top;
  width: 45%;
}

.product-card__specs td {
  text-align: right;
  font-size: var(--text-small);
  color: var(--gray-80);
  padding: 0.4rem 0;
  border-bottom: var(--border-width) solid var(--gray-10);
}

.product-card__footer {
  border-top: var(--border-width) solid var(--gray-10);
  padding-top: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
