/* ============================================
   1. Reset & Base
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', sans-serif;
  background: #eef2f5;
  color: #333;
  line-height: 1.5;
  padding: 20px;
}
a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   2. Color Palette & Variables
   ============================================ */
:root {
  --primary: #005b7f;       /* Deep teal from logo */
  --secondary: #7a6351;     /* Brown/Gray from logo text */
  --accent: #28a745;        /* Bright accent */
  --danger: #dc3545;        /* Red for logout */
  --bg-light: #fafbfc;      /* Very light gray */
  --bg-lighter: #f0f4f8;    /* Light gray */
  --text-dark: #222;        /* Dark text */
}

/* ============================================
   3. Global Containers
   ============================================ */
.container,
.form-container,
.login-box {
  max-width: 820px;
  margin: 40px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  padding: 30px 40px;
}

/* ============================================
   4. Navbar
   ============================================ */
.navbar {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  padding: 12px 20px;
}
.nav-container {
  max-width: 820px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar .brand img {
  max-height: 45px;
  filter: none;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 20px;
}
.nav-menu li a {
  color: var(--secondary);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
}
.nav-menu li a:hover {
  color: var(--primary);
  background: rgba(0,91,127,0.1);
}

/* Responsive Navbar */
@media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    gap: 10px;
  }
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ============================================
   5. Header (Template Page)
   ============================================ */
header {
  background: #fff;
  border-bottom: 4px solid var(--primary);
  text-align: center;
  padding: 30px 20px;
}
header img {
  max-width: 200px;
  filter: none;
}

/* ============================================
   6. Headings & Typography
   ============================================ */
h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 25px;
}
h2,
.form-container h2,
.login-box h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 15px;
}
h2 i {
  margin-right: 10px;
  color: var(--accent);
}
p,
label,
.info div {
  font-size: 14px;
  color: var(--text-dark);
}

/* ============================================
   7. Client Info Grid (Template Page)
   ============================================ */
.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.info div {
  background: var(--bg-lighter);
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}
.info strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--secondary);
}

/* ============================================
   8. Scope Box
   ============================================ */
.scope-box {
  background: var(--bg-light);
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 40px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.04);
}

/* ============================================
   9. Investment Table
   ============================================ */
.invest-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}
.invest-table th,
.invest-table td {
  padding: 12px 15px;
  text-align: left;
}
.invest-table thead th {
  background: var(--bg-light);
  font-weight: 600;
}
.invest-table tbody tr:nth-child(odd) {
  background: var(--bg-lighter);
}

/* ============================================
   10. Preformatted Blocks (Timeline, Payment, Next)
   ============================================ */
pre {
  background: var(--bg-light);
  border-left: 4px solid var(--accent);
  padding: 20px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}

/* ============================================
   11. Signature Block
   ============================================ */
.signature {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 14px;
}
.signature .name {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.signature div {
  margin: 4px 0;
}

/* ============================================
   12. Action Buttons
   ============================================ */
.actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 50px 0 30px;
}
.btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 25px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-print {
  background: var(--accent);
}
.btn-print:hover {
  background: #24a03d;
  transform: translateY(-2px);
}
.btn-logout {
  background: var(--danger);
}
.btn-logout:hover {
  background: #c31f37;
  transform: translateY(-2px);
}

/* ============================================
   13. Footer
   ============================================ */
footer {
  background: var(--bg-light);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--secondary);
}

/* ============================================
   14. Form Page Styles
   ============================================ */
.form-container {
  padding: 40px 50px;
}
.form-container label {
  display: block;
  margin: 15px 0 5px;
  font-weight: 600;
  color: var(--secondary);
}
.form-container input,
.form-container select,
.form-container textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 10px;
}
.form-container button {
  background: var(--primary);
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, transform 0.1s;
}
.form-container button:hover {
  background: #004a65;
  transform: translateY(-2px);
}
.form-container .logout {
  float: right;
  color: var(--danger);
  text-decoration: none;
  margin-top: -40px;
}

/* ============================================
   15. Login Page Styles
   ============================================ */
.login-box {
  max-width: 420px;
  margin: 80px auto;
  background: #fff;
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  text-align: center;
}
.login-box h2 {
  margin-bottom: 20px;
  color: var(--primary);
}
.login-box input {
  width: 100%;
  padding: 12px 14px;
  margin-top: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
}
.login-box button {
  margin-top: 30px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 0;
  width: 100%;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: background 0.3s, transform 0.1s;
}
.login-box button:hover {
  background: #004a65;
  transform: translateY(-2px);
}
.login-box .error {
  margin-top: 20px;
  color: var(--danger);
  font-size: 14px;
}

/* ============================================
   16. Print Styles for PDF
   ============================================ */
@media print {
  .navbar,
  .actions,
  footer,
  .login-box,
  .form-container {
    display: none !important;
  }
  body {
    padding: 0;
  }
  .container {
    box-shadow: none;
    margin: 0;
    border-radius: 0;
  }
  header {
    border-bottom: none;
  }
  main {
    padding: 20px;
  }
  .signature {
    page-break-inside: avoid;
  }
}
