/* =======================================================================
   RESPONSIVE THEME VARIABLES (from other app)
   ======================================================================= */
:root {
  --container-pad: clamp(10px, 2vw, 24px);
  --header-h: clamp(72px, 10vh, 115px);
  --footer-h: clamp(28px, 4.5vh, 40px);
  --header-pad-x: clamp(10px, 2vw, 18px);
  --logo-main-h: clamp(42px, 6.8vh, 78px);
  --logo-estate-h: clamp(36px, 6vh, 62px);
  --title-fs: clamp(18px, 2.0vw, 34px);
  --subtitle-fs: clamp(11px, 1.15vw, 16px);
  --btn-fs: clamp(12px, 1.05vw, 14px);
  --btn-pad-y: clamp(8px, 1vw, 12px);
  --btn-pad-x: clamp(10px, 1.2vw, 15px);

  --brand-blue: rgb(94, 10, 2);
  --brand-blue-hover: rgb(75, 10, 4);

  --panel-bg-rgb: 13, 62, 89;
  --panel-alpha: 0.78;
}

/* =======================================================================
   GLOBAL
   ======================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  background-color: #333333;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Content area */
.container { flex: 1; padding: var(--container-pad); }

/* =======================================================================
   HEADER (matches other app responsive sizing)
   ======================================================================= */
.banner-header {
  position: relative;
  min-height: var(--header-h);
  background-image: url("../images/voltanoengineering.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Optional overlay for readability */
.banner-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.20) 45%,
    rgba(0, 0, 0, 0.05) 100%
  );
  pointer-events: none;
}

.banner-inner {
  position: relative;
  z-index: 1;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
  padding: 0 var(--header-pad-x);
}

/* Main company logo (always shown) */
.banner-logo-main {
  height: var(--logo-main-h);
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  padding: clamp(4px, 0.8vw, 6px);
  background: rgba(255, 255, 255, 0.06);
}

/* Estate logo (optional) */
.banner-logo-estate {
  height: var(--logo-estate-h);
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  padding: clamp(4px, 0.8vw, 6px);
  background: rgba(255, 255, 255, 0.06);
}

.banner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  white-space: nowrap;
}

.banner-title {
  font-size: var(--title-fs);
  font-weight: 700;
  margin: 0;
}

.banner-subtitle {
  font-size: var(--subtitle-fs);
  margin-top: clamp(3px, 0.6vw, 6px);
  opacity: 0.95;
  min-height: 18px;
}

/* Right-side header area (your modular base.html exposes this block) */
.banner-user {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Optional “badge/link” styling if host injects content */
.user-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}

.banner-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px 10px;
  border-radius: 8px;
}
.banner-link:hover {
  background: rgba(0, 0, 0, 0.30);
  text-decoration: underline;
}

/* =======================================================================
   FOOTER
   ======================================================================= */
.app-footer {
  background-color: var(--brand-blue);
  color: #ffffff;
  text-align: center;
  padding: clamp(6px, 1vw, 10px);
  flex-shrink: 0;
  height: var(--footer-h);
}

/* =======================================================================
   HOME PAGE (Province cards)
   ======================================================================= */
.home-title {
  margin: 0;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  justify-content: center;
}

/* Updated card style to match other app (“blue panel” tiles) */
.card {
  display: block;
  width: 240px;
  background: rgb(94, 10, 2);
  border-radius: 10px;
  padding: 10px;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card:hover {
  transform: scale(1.02);
  background: var(--brand-blue-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

.card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #222;
  border-radius: 8px;
  display: block;
}

.card-title {
  padding: 10px 4px 2px;
  font-weight: bold;
  text-align: center;
}

/* (Optional) logo box helper (from other app). Safe even if unused. */
.card .cr-logo-box {
  height: 140px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
}
.card .cr-logo-box img.cr-estate-logo {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
  border-radius: 0 !important;
  display: block;
}

/* =======================================================================
   FULL-SCREEN BACKGROUND PAGES
   ======================================================================= */
.page-bg {
  position: relative;
  width: calc(100% + (var(--container-pad) * 2));
  margin-left: calc(var(--container-pad) * -1);
  margin-right: calc(var(--container-pad) * -1);
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow: hidden;
  background: #333333;
}

.page-bg__image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.page-bg__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 0;
}

.page-content {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 4vw, 60px) clamp(12px, 2vw, 20px) clamp(18px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  text-align: center;
}

.page-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

/* Updated back button to match other app */
.back-button {
  position: absolute;
  top: clamp(10px, 1.5vw, 15px);
  left: clamp(10px, 1.5vw, 15px);
  background-color: rgba(21, 82, 114, 0.95);
  border: none;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: var(--btn-fs);
  cursor: pointer;
  color: #ffffff;
  z-index: 10;
  border-radius: 4px;
  text-decoration: none;
}
.back-button:hover { background-color: var(--brand-blue-hover); }

/* =======================================================================
   BUTTONS
   ======================================================================= */
.button-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}
.button-group--center { margin-top: 35px; }

.btn {
  display: inline-block;
  background-color: #155272;
  border: none;
  color: #ffffff;
  padding: 18px 36px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { background-color: var(--brand-blue-hover); }
.btn--large { padding: 22px 52px; font-size: 18px; }

/* Utility icon buttons (keep from original dashboard css) */
.utility-image {
  background-color: rgba(21, 82, 114, 0.95);
  width: 120px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.utility-image:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

/* Estate tile images (keep) */
.estate-image {
  background-color: #333333;
  height: 90px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  cursor: pointer;
}
.estate-image:hover { transform: scale(1.05); }

/* =======================================================================
   REPORT IFRAME (keep from original dashboard css)
   ======================================================================= */
.responsive-iframe-container {
  width: 80%;
  height: calc(100vh - 220px);
  margin-top: 30px;
  overflow: hidden;
}
.responsive-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #333333;
}

/* =======================================================================
   AUTH (login) page styles (keep from original dashboard css)
   Safe even if host project handles login.
   ======================================================================= */
.auth-wrap {
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 92vw);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 26px 22px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0 0 18px;
  opacity: 0.92;
}

.auth-alert {
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.40);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 14px;
  text-align: left;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-row label {
  font-size: 13px;
  opacity: 0.92;
}

.form-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  outline: none;
}

.form-row input:focus {
  border-color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.08);
}

.auth-btn {
  margin-top: 8px;
  background-color: rgb(94, 10, 2);
  border: none;
  color: #ffffff;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  transition: background-color 0.2s;
}
.auth-btn:hover { background-color: var(--brand-blue-hover); }

.auth-help {
  margin: 14px 0 0;
  opacity: 0.85;
  font-size: 13px;
}

/* =======================================================================
   RESPONSIVE TWEAKS
   ======================================================================= */
@media (max-width: 760px) {
  .banner-inner { height: auto; padding: 14px; flex-wrap: wrap; }
  .banner-header { min-height: auto; }
  .banner-title { font-size: 26px; }
  .banner-logo-main { height: 60px; }
  .banner-logo-estate { height: 54px; }
  .card { width: 280px; }
  .btn--large { width: 220px; text-align: center; }
}