/* =============================================================
   Green Button – Shared Stylesheet
   ============================================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Avenir Next", "Segoe UI", Montserrat, Manrope, Arial, sans-serif;
  font-size: 14px;
  color: #004F71;
  background: #EAF3F4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #007C80; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; margin-bottom: 0.25rem; }

p { margin-bottom: 0.75rem; line-height: 1.6; }
ul { padding-left: 1.25rem; }

/* ---- Layout ---- */
.page-content { flex: 1; padding: 2rem 1rem; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow { max-width: 760px; }

/* ---- Header / Nav ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 56px;
  background: #013354;
}

.nav-logo img { height: 80px; width: auto; object-fit: contain; }

.app-nav {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.app-nav a {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
}

.app-nav a:hover { color: #7FE3E7; }

.app-nav a.nav-cta { color: #2CCCD3; }
.app-nav a.nav-cta:hover { color: #7FE3E7; }

.nav-logout-form { display: inline; margin: 0; }

.nav-link-button {
  background: none;
  border: none;
  padding: 0;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
}

.nav-link-button:hover { color: #7FE3E7; }

/* ---- Hero ---- */
.hero {
  position: relative;
  flex: 1;
  min-height: 560px;
  background:
    linear-gradient(90deg, rgba(0, 79, 113, 0.95), rgba(0, 124, 128, 0.75)),
    url("../images/power-grid.jpg");
  background-size: cover;
  background-position: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1500px;
  margin: 0 auto;
  padding: 80px;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 80px;
  align-items: center;
}

.eyebrow {
  color: #2CCCD3;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  color: #ffffff;
  font-size: 60px;
  line-height: 1.08;
  margin: 0 0 24px;
  max-width: 720px;
}

.hero-copy {
  color: #ffffff;
  font-size: 22px;
  line-height: 1.55;
  max-width: 720px;
  margin-bottom: 0;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 24px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 18px 42px;
  border-radius: 9px;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn.primary,
.btn-primary {
  background: #2CCCD3;
  color: #004F71;
}

.btn.primary:hover,
.btn-primary:hover {
  opacity: 0.88;
  text-decoration: none;
  color: #004F71;
}

.btn.secondary {
  color: #ffffff;
  border: 2px solid #ffffff;
  background: transparent;
}

.btn.secondary:hover { color: #7FE3E7; border-color: #7FE3E7; text-decoration: none; }

.btn.outline {
  color: #004F71;
  border: 2px solid #D7E2E5;
  background: transparent;
}

.btn.outline:hover { border-color: #2CCCD3; color: #007C80; text-decoration: none; }

.btn.outline.danger { border-color: #c0392b; color: #c0392b; }
.btn.outline.danger:hover { background: #c0392b; color: #fff; }

.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---- Auth screens (TP / admin login) ---- */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.auth-main.dark { background: #002236; }

.auth-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  padding: 56px 64px;
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.auth-card h1 { font-size: 28px; margin-bottom: 16px; }
.auth-card p { font-size: 16px; color: #4F4F4F; }
.auth-card .auth-note { margin-top: 24px; margin-bottom: 0; font-size: 13px; color: #8a8f93; }

/* ---- Hero card (index right column) ---- */
.hero-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 44px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.hero-card img { width: 180px; height: auto; margin-bottom: 20px; }
.hero-card h2 { font-size: 28px; margin: 0; }
.hero-card h3 { font-size: 20px; margin: 0 0 20px; }

.accent-line {
  width: 56px;
  height: 4px;
  background: #2CCCD3;
  margin: 22px auto;
}

.hero-card p { font-size: 18px; line-height: 1.55; margin-bottom: 0; }

/* ---- Hero card checklist ---- */
.checklist {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 1.05rem;
  text-align: left;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.checklist .check-mark {
  color: #2CCCD3;
  font-weight: 800;
}

/* ---- Feature section (index bottom row) ---- */
.feature-section {
  max-width: 1450px;
  margin: 0 auto;
  padding: 36px 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 34px;
  display: flex;
  gap: 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
}

.feature-icon {
  width: 88px;
  height: 88px;
  min-width: 88px;
  border-radius: 50%;
  background: #E3F7F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.feature-card h3 { margin: 0 0 12px; font-size: 24px; }
.feature-card p  { margin: 0; font-size: 18px; line-height: 1.45; }

/* ---- Footer ---- */
.app-footer {
  background: #002236;
  color: #B8D8DB;
  padding: 40px 56px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.app-footer a { color: #B8D8DB; }
.app-footer a:hover { color: #7FE3E7; }

.footer-nav {
  list-style: none;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

/* ---- General cards ---- */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
  padding: 1.5rem;
}

.card-flush { padding: 0; }

/* ---- Tables ---- */
.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

thead tr { background: #EAF3F4; }
thead th { color: #4F4F4F; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }
th, td { padding: 0.9rem 1.1rem; text-align: left; border-bottom: 1px solid #eee; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #D6EEEF; }

.text-right { text-align: right; }

.empty-state { padding: 1.5rem; }

/* ---- Utility ---- */
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

caption { font-weight: bold; text-align: left; padding: 0.5rem 0; color: #004F71; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
label { display: inline-block; margin-right: 0.5rem; }
input[type="checkbox"] { margin-right: 0.4rem; vertical-align: middle; }

select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.required-mark { color: #c0392b; }

.card-lg { padding: 40px; }

.form-card { max-width: 640px; margin: 0 auto; }

.card-outline {
  background: #ffffff;
  border: 1px solid #D7E2E5;
  border-radius: 12px;
  padding: 32px;
  margin-top: 24px;
}

.detail-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.form-section-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.875rem;
  color: #004F71;
  margin-bottom: 20px;
}

.field-label {
  font-weight: 700;
  font-size: 0.8125rem;
  color: #004F71;
  display: block;
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.75rem;
  color: #8a8f93;
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #D7E2E5;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #004F71;
  font-family: inherit;
}

.form-textarea { resize: vertical; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ---- Compact filter/toolbar bar (search, sort, quick-add fields) ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
  min-width: 140px;
}

.filter-field-sm { flex: 0 1 150px; min-width: 110px; }

.filter-bar .field-label { margin-bottom: 0; font-size: 0.7rem; }

.filter-bar .form-input,
.filter-bar select {
  padding: 7px 10px;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---- Admin management table row actions ---- */
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-actions-left,
.admin-actions-right {
  display: flex;
  align-items: center;
}

.admin-actions-right { margin-left: auto; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.warning { background: #FDF3D9; color: #8a6d1d; }
.badge.success { background: #E1F5E9; color: #1e7b45; }
.badge.error   { background: #FBE4E1; color: #a5301f; }
.badge.info    { background: #E3F7F8; color: #007C80; }

/* ---- Status banner (TP submission status) ---- */
.status-banner {
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.status-banner.warning { background: #FDF3D9; }
.status-banner.success { background: #E1F5E9; }
.status-banner.error   { background: #FBE4E1; }
.status-banner.info    { background: #E3F7F8; }

.status-banner h3 { margin-bottom: 6px; font-size: 1rem; }
.status-banner p  { margin-bottom: 0; }

/* ---- Submission detail view ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #4F4F4F;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  font-size: 0.875rem;
  margin-bottom: 32px;
}

.detail-field { margin-bottom: 16px; }

.detail-field .detail-label {
  color: #8a8f93;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.detail-field .detail-value { font-weight: 600; }

/* ---- Page sections ---- */
.section { margin-bottom: 2rem; }

.page-title { font-size: 1.3rem; color: #004F71; margin-bottom: 1rem; font-weight: bold; }
.subtitle   { color: #4F4F4F; margin-bottom: 1.25rem; }

/* ---- Utility provider row ---- */
/*.provider-table td { vertical-align: middle; padding: 0.75rem; }*/
/*.provider-table td img { max-height: 50px; max-width: 75px; }*/
.thumbnail-img { max-height: 50px; max-width: 75px; vertical-align: middle; }
.thumbnail-img-block { display: block; margin-bottom: 6px; }
.logo-preview { display: block; margin-top: 10px; }

/* ---- Error page ---- */
.error-box { color: #c0392b; font-weight: bold; margin: 1rem 0; }

.success-box { color: #1e7e34; font-weight: bold; margin: 1rem 0; }

.error-content { text-align: center; padding-top: 3rem; padding-bottom: 3rem; }

/* ---- Revoke confirmation ---- */
.confirm-box {
  background: #EAF3F4;
  border-left: 4px solid #2CCCD3;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  line-height: 1.8;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #ffffff;
  border-radius: 12px;
  max-width: 600px;
  width: 95%;
  padding: 1.5rem;
}

.modal-box h4 { margin-bottom: 0.75rem; }

.modal-scroll {
  height: 130px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* ---- imageRef fragment ---- */
.provider-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
  margin-bottom: 1rem;
}

.provider-card img { max-height: 50; max-width: 50px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #8FB9C2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #004F71; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  header, .site-header {
    height: auto;
    padding: 24px;
    flex-direction: column;
  }

  nav.nav, .nav { gap: 22px; padding-top: 18px; }
  nav ul { gap: 22px; padding-top: 18px; }

  .hero-content {
    grid-template-columns: 1fr;
    padding: 48px 28px;
  }

  .hero h1 { font-size: 42px; }

  .feature-section {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  footer, .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

  .provider-card { grid-template-columns: 1fr; }
  table { font-size: 1rem; }
  th, td { padding: 0.5rem; }
}

/* ---- Provider card grid ---- */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.provider-grid .provider-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: #ffffff;
  border: 1px solid #D7E2E5;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  text-align: center;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.provider-grid .provider-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #2CCCD3;
}

.provider-grid .provider-card img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}

.provider-grid .provider-name {
  font-size: 0.85rem;
  color: #004F71;
  flex: 1;
}

.provider-grid .btn {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 1024px) {
  .provider-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Scope card layout */
    .scope-page { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }

    .scope-page h1 {
      text-align: center;
      font-size: 1.75rem;
      color: #004F71;
      margin-bottom: 0.5rem;
    }

    .scope-subtitle {
      text-align: center;
      color: #4F4F4F;
      max-width: 620px;
      margin: 0 auto 2rem;
      line-height: 1.55;
      font-size: 0.95rem;
    }

    /* Individual scope card */
    .scope-card {
      border: 2px solid #D7E2E5;
      border-radius: 12px;
      padding: 20px 20px;
      background: #fff;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
      margin-bottom: 1rem;
	  columns: 3;
    }

    .scope-card.selected {
      border-color: #2CCCD3;
      background: #E3F7F8;
    }

    .scope-card-head {
      display: flex;
      align-items: flex-start;
      gap: 14px;
    }

    .scope-card-head input[type=radio] {
      margin-top: 4px;
      width: 18px;
      height: 18px;
      accent-color: #2CCCD3;
      flex-shrink: 0;
    }

    .scope-card-title {
      font-size: 0.75rem;
      font-weight: 600;
      color: #004F71;
    }

    .scope-raw {
      font-size: 0.78rem;
      color: #4F4F4F;
      margin-top: 4px;
    }

    /* Technical details toggle */
    details.scope-tech { margin-top: 12px; margin-left: 32px; }

    details.scope-tech summary {
      font-size: 0.8rem;
      color: #007C80;
      cursor: pointer;
      font-weight: 600;
      list-style: none;
    }

    details.scope-tech summary::-webkit-details-marker { display: none; }
    details.scope-tech summary::before { content: "▸ "; }
    details.scope-tech[open] summary::before { content: "▾ "; }

    details.scope-tech .tech-body {
      margin-top: 8px;
      background: #f4f5f4;
      border-radius: 8px;
      padding: 10px 14px;
      font-family: "SF Mono", Consolas, monospace;
      font-size: 0.75rem;
      color: #4F4F4F;
      word-break: break-all;
    }

    /* Provider select */
    .provider-group {
      background: #fff;
      border: 1px solid #D7E2E5;
      border-radius: 12px;
      padding: 20px 24px;
      margin-bottom: 1.5rem;
    }

    .provider-group label {
      font-weight: 700;
      color: #004F71;
      display: block;
      margin-bottom: 8px;
    }

    .provider-group select {
      width: 100%;
      padding: 10px 14px;
      border: 1px solid #ccc;
      border-radius: 8px;
      font-size: 0.95rem;
      color: #004F71;
    }

    /* Footnotes */
    .scope-footnotes {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      justify-content: center;
      font-size: 0.82rem;
      color: #4F4F4F;
      margin: 1.5rem 0;
    }

    .scope-footnotes .item { display: flex; align-items: center; gap: 6px; }
    .scope-footnotes .item .dot { color: #007C80; font-size: 1rem; }

    /* CTA area */
    .scope-cta { text-align: center; margin-top: 1.5rem; }

    .scope-cta input[type=submit] {
      background: linear-gradient(135deg, #004F71, #2CCCD3);
      color: #fff;
      border: none;
      padding: 14px 36px;
      font-size: 1rem;
      font-weight: 700;
      border-radius: 9px;
      cursor: pointer;
      transition: opacity 0.2s;
    }

    .scope-cta input[type=submit]:hover { opacity: 0.88; }

    .scope-cta input[type=submit]:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .scope-redirect-note {
      text-align: center;
      font-size: 0.8rem;
      color: #4F4F4F;
      margin-top: 10px;
    }
