/* ==========================================================================
   R&M Trucking Customer Portal - Shared Styles
   Matches rmtrucking.com look & feel + Kyle's CodePen portal layout
   ========================================================================== */

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

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333333;
  background-color: #f2f2f2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #2b7bb9;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #1e5a8a;
  text-decoration: underline;
}

/* --- Top Header Bar (matches rmtrucking.com) --- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.header-logo img {
  height: 50px;
  width: auto;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.header-nav a {
  color: #333333;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  padding: 8px 0;
  position: relative;
}
.header-nav a:hover {
  color: #aa2222;
  text-decoration: none;
}
.header-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #aa2222;
  transition: width 0.2s ease;
}
.header-nav a:hover::after {
  width: 100%;
}

/* --- Portal Layout (sidebar + content, from CodePen) --- */
.portal-wrapper {
  display: flex;
  flex: 1;
  max-width: 1200px;
  margin: 24px auto;
  width: 100%;
  padding: 0 24px;
  gap: 24px;
}

/* --- Sidebar (from Kyle's CodePen mockup) --- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #757575;
  padding: 0 16px 8px;
}
.sidebar-nav {
  list-style: none;
}
.sidebar-nav li a {
  display: block;
  padding: 10px 16px;
  color: #333333;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.sidebar-nav li a:hover {
  background: #e8f0f8;
  color: #2b7bb9;
  text-decoration: none;
}
.sidebar-nav li a.active {
  background: #2b7bb9;
  color: #ffffff;
}
.sidebar-nav li a.disabled {
  color: #b0b0b0;
  cursor: default;
  pointer-events: none;
}
/* Direct sidebar links (used by production-first chrome) */
.sidebar-link {
  display: block;
  padding: 10px 16px;
  color: #333333;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.sidebar-link:hover {
  background: #e8f0f8;
  color: #2b7bb9;
  text-decoration: none;
}
.sidebar-link i {
  width: 20px;
  text-align: center;
  margin-right: 6px;
  color: #2b7bb9;
}

/* --- Logo --- */
.logo {
  max-height: 40px;
  width: auto;
}
.logo-link {
  display: flex;
  align-items: center;
}

/* --- Main Content Card --- */
.content-area {
  flex: 1;
  min-width: 0;
}
.content-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  padding: 32px;
}
.content-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.content-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #333333;
}
.logged-in-badge {
  font-size: 13px;
  color: #757575;
}
.logged-in-badge strong {
  color: #2b7bb9;
}

/* --- Form Styles --- */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-label .required {
  color: #aa2222;
}
.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #ffffff;
  color: #333;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #2b7bb9;
  box-shadow: 0 0 0 3px rgba(43, 123, 185, 0.15);
}
.form-input::placeholder {
  color: #aaa;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group {
  flex: 1;
}
.form-hint {
  font-size: 13px;
  color: #757575;
  margin-top: 4px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: #2b7bb9;
  color: #ffffff;
}
.btn-primary:hover {
  background: #1e5a8a;
  color: #ffffff;
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  color: #757575;
  border: 1px solid #d0d0d0;
}
.btn-secondary:hover {
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
}
.btn-maroon {
  background: #aa2222;
  color: #ffffff;
}
.btn-maroon:hover {
  background: #8c1c1c;
  color: #ffffff;
  text-decoration: none;
}
.btn-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* --- Error Message --- */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px 16px;
  color: #aa2222;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* --- Info Box --- */
.info-box {
  background: #f0f7ff;
  border: 1px solid #bdd7f1;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  color: #1e5a8a;
  margin-top: 20px;
}

/* --- Footer --- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 24px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  margin-bottom: 12px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 6px;
}
.footer-col ul li a {
  font-size: 14px;
  color: #757575;
}
.footer-col ul li a:hover {
  color: #2b7bb9;
}
.footer-col p {
  font-size: 14px;
  color: #757575;
  line-height: 1.7;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #999;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .portal-wrapper {
    flex-direction: column;
    padding: 0 16px;
  }
  .sidebar {
    width: 100%;
  }
  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .sidebar-nav li a {
    padding: 8px 14px;
    font-size: 13px;
  }
  .content-card {
    padding: 20px;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .header-nav {
    display: none;
  }
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Print --- */
@media print {
  .sidebar,
  .site-header,
  .site-footer,
  .header-nav {
    display: none;
  }
  .portal-wrapper {
    display: block;
  }
  .content-area {
    margin: 0;
    padding: 0;
    width: 100%;
  }
  body {
    background: white;
    font-size: 12px;
  }
}
