*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

:root {
  --max-width: 1200px;
  --background-color: #eaeede;
  --white-color: snow;
  --black-color: #0f0f0f;
  --main-color: #655139;
  --heading-color: #404040;
  --border-color: #e0dbd6;
  --button-orange: #e77e53;
  --button-orange-hover: #d56a3f;
  --accent-green: #a3c264;
  --accent-green-hover: #8caf4d;
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--background-color);
  color: var(--black-color);
  font-family: var(--sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

a {
  color: inherit;
}

/* ---------- PAGE WRAPPER (hub) ---------- */

.page-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  background: var(--background-color);
  flex: 1;
}

.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.brand-link {
  margin-inline: auto;
  display: block;
}

.brand-link img {
  width: 250px;
  height: auto;
  display: block;
}

.page-container h1 {
  margin-top: 1rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--heading-color);
}

.page-container .subtitle {
  margin-top: -0.5rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--main-color);
}

.green-divider {
  width: 180px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 4px;
  margin: 0.25rem 0 0.5rem;
}

.highlight-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.5rem;
}

.stat-pill {
  background: var(--button-orange);
  color: var(--white-color);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  box-shadow: 0 6px 16px rgba(231, 126, 83, 0.25);
}

.stat-pill .stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
}

.stat-pill .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-pill .stat-suffix {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
}

.payout-list {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  font-size: 0.92rem;
  color: #4a4a4a;
}

.payout-list li {
  padding: 0.2rem 0.65rem;
  background: rgba(101, 81, 57, 0.08);
  border-radius: 0.25rem;
}

.page-container ul {
  padding-left: 1.25rem;
  line-height: 1.9;
  font-size: 1rem;
}

.page-container ul li {
  margin-bottom: 0.15rem;
}

.docs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: start;
}

.docs h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.doc-button {
  background: var(--button-orange);
  color: var(--white-color);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  transition: background 0.18s ease, transform 0.18s ease;
}

.doc-button:hover {
  background: var(--button-orange-hover);
}

.doc-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.doc-button.is-disabled:hover {
  background: var(--button-orange);
}

.doc-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* ---------- FOOTER ---------- */

.site-footer {
  background: var(--white-color);
  border-top: 1px solid var(--border-color);
}

.site-footer-inner {
  max-width: var(--max-width);
  padding: 3rem 2rem;
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer-inner img {
  width: 200px;
  height: auto;
  display: block;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-right a,
.footer-right .footer-text {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-right a:hover {
  color: var(--main-color);
}

.footer-logout {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  font-family: inherit;
  transition: color 0.2s ease;
}

.footer-logout:hover {
  color: var(--main-color);
}

/* ---------- LOGIN ---------- */

.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  width: 100%;
}

.login-page .brand-link {
  margin-bottom: 2.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  background: var(--white-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--heading-color);
}

.login-header p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #6b6358;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--main-color);
}

.login-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: var(--white-color);
  color: var(--black-color);
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.error-message {
  margin: 0;
  color: #b3261e;
  font-size: 0.875rem;
}

.login-form button {
  margin-top: 0.5rem;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 0.25rem;
  background: var(--accent-green);
  color: var(--white-color);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease;
  box-shadow: 0 6px 16px rgba(163, 194, 100, 0.3);
}

.login-form button:hover:not(:disabled) {
  background: var(--accent-green-hover);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(163, 194, 100, 0.25);
}

.login-card {
  border-top: 4px solid var(--accent-green);
}

.login-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- VIEWER ---------- */

.viewer-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--white-color);
  border-bottom: 1px solid var(--border-color);
}

.viewer-header .brand-link {
  margin-inline: 0;
}

.viewer-header .brand-link img {
  width: 180px;
}

.viewer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-link {
  padding: 0.55rem 1rem;
  border: 1px solid #333;
  border-radius: 0.25rem;
  background: transparent;
  color: #333;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-link:hover {
  background: #333;
  color: var(--white-color);
}

.btn-link.filled {
  background: var(--button-orange);
  border-color: var(--button-orange);
  color: var(--white-color);
}

.btn-link.filled:hover {
  background: var(--button-orange-hover);
  border-color: var(--button-orange-hover);
}

.viewer-main {
  flex: 1;
  padding: 1.25rem 2rem 2rem;
  background: var(--background-color);
}

#pdf-frame {
  width: 100%;
  height: calc(100vh - 130px);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: white;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 768px) {
  .site-footer-inner {
    flex-direction: column;
    gap: 3rem;
  }

  .footer-right {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 550px) {
  .page-container {
    padding: 1.5rem;
  }

  .page-container h1 {
    font-size: 1.5rem;
  }

  .brand-link img {
    width: 200px;
  }

  .login-card {
    padding: 1.75rem;
  }

  .viewer-header {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .viewer-header .brand-link {
    margin-inline: auto;
  }

  .viewer-actions {
    justify-content: stretch;
  }

  .btn-link {
    flex: 1;
    text-align: center;
  }

  .viewer-main {
    padding: 0.75rem;
  }

  #pdf-frame {
    height: calc(100vh - 200px);
  }
}
