/* ==========================================================================
   Client portal — builds on styles.css tokens (--gold, --navy, --paper ...)
   ========================================================================== */

.portal-body {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-body main {
  flex: 1 0 auto;
}

/* Page header band (same green gradient family as the site hero) */
.portal-hero {
  background: linear-gradient(115deg, rgb(60, 103, 86), rgb(20, 74, 51));
  color: #fff;
  overflow: hidden;
  padding: 2.75rem 0 4.5rem;
  position: relative;
}

.portal-hero::after {
  border: 1px solid rgba(203, 150, 45, 0.28);
  border-radius: 999px;
  content: "";
  height: 360px;
  position: absolute;
  right: -120px;
  top: -140px;
  width: 360px;
}

[dir="rtl"] .portal-hero::after {
  left: -120px;
  right: auto;
}

.portal-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  margin: 0;
}

.portal-hero p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0.5rem 0 0;
  max-width: 720px;
}

.portal-hero .eyebrow {
  color: #f0d48a;
}

.portal-content {
  margin-top: -2.75rem;
  padding-bottom: 4rem;
  position: relative;
  z-index: 1;
}

/* Cards */
.portal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(22, 82, 57, 0.06);
  padding: 1.75rem;
}

.portal-card + .portal-card {
  margin-top: 1.5rem;
}

.portal-card-title {
  align-items: center;
  color: var(--navy);
  display: flex;
  font-size: 1.1rem;
  font-weight: 800;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.portal-card-title i {
  color: var(--gold);
}

/* Auth pages */
.auth-wrap {
  margin-inline: auto;
  max-width: 520px;
}

.auth-wrap.wide {
  max-width: 640px;
}

.auth-icon {
  align-items: center;
  background: rgba(203, 150, 45, 0.13);
  border-radius: 50%;
  color: var(--gold);
  display: flex;
  font-size: 1.8rem;
  height: 64px;
  justify-content: center;
  margin: 0 auto 1rem;
  width: 64px;
}

.secure-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1.25rem;
  text-align: center;
}

.secure-note i {
  color: var(--navy);
}

/* Forms */
.portal-form .form-label {
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.portal-form .form-label .optional {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.portal-form .form-control,
.portal-form .form-select {
  border-color: var(--line);
  border-radius: 12px;
  min-height: 48px;
  padding: 0.7rem 1rem;
}

[dir="rtl"] .portal-form .form-select {
  background-position: left 0.75rem center;
  padding-left: 2.25rem;
}

.portal-form textarea.form-control {
  min-height: 140px;
}

.portal-form .form-control:focus,
.portal-form .form-select:focus,
.portal-form .form-check-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(203, 150, 45, 0.18);
}

.portal-form .form-check-input:checked {
  background-color: var(--navy);
  border-color: var(--navy);
}

.portal-form .form-text {
  color: var(--muted);
}

.form-section-title {
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
  margin: 2rem 0 1.25rem;
  padding-bottom: 0.6rem;
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-section-title span {
  background: var(--gold);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  height: 26px;
  justify-content: center;
  align-items: center;
  margin-inline-end: 0.5rem;
  width: 26px;
}

/* Honeypot — kept off-screen rather than display:none */
.hp-field {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

/* File drop zone */
.file-drop {
  background: var(--paper);
  border: 2px dashed rgba(203, 150, 45, 0.45);
  border-radius: 14px;
  cursor: pointer;
  padding: 1.5rem;
  position: relative;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.file-drop:hover,
.file-drop.dragover {
  background: rgba(203, 150, 45, 0.07);
  border-color: var(--gold);
}

.file-drop i {
  color: var(--gold);
  font-size: 1.8rem;
}

.file-drop input[type="file"] {
  inset: 0;
  opacity: 0;
  position: absolute;
  cursor: pointer;
}

.file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.file-list li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.4rem 0;
}

.file-list li.invalid {
  color: #b02a37;
}

/* Buttons */
.btn-portal {
  align-items: center;
  background: linear-gradient(135deg, #cb962d, #e5bf68);
  border: none;
  border-radius: 50px;
  box-shadow: 0 10px 24px rgba(203, 150, 45, 0.22);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-portal:hover,
.btn-portal:focus {
  box-shadow: 0 16px 32px rgba(203, 150, 45, 0.32);
  color: #fff;
  transform: translateY(-2px);
}

.btn-portal:disabled {
  opacity: 0.7;
  transform: none;
}

.btn-portal-outline {
  align-items: center;
  border: 1px solid rgba(22, 82, 57, 0.25);
  border-radius: 50px;
  color: var(--navy);
  display: inline-flex;
  font-weight: 700;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-portal-outline:hover {
  background: var(--navy);
  color: #fff;
}

.btn-portal-sm {
  font-size: 0.85rem;
  padding: 0.4rem 0.95rem;
}

.link-gold {
  color: var(--gold-dark);
  font-weight: 700;
}

.link-gold:hover {
  color: var(--navy);
}

/* Portal navigation additions */
.portal-nav .nav-link {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.portal-nav .nav-link i {
  color: var(--gold);
}

.nav-bell {
  align-items: center;
  border: 1px solid rgba(203, 150, 45, 0.3);
  border-radius: 50%;
  color: var(--navy);
  display: inline-flex;
  font-size: 1.15rem;
  height: 46px;
  justify-content: center;
  position: relative;
  width: 46px;
}

.nav-bell:hover {
  background: rgba(203, 150, 45, 0.08);
  color: var(--gold);
}

.nav-bell .badge {
  font-size: 0.65rem;
  inset-inline-end: -4px;
  position: absolute;
  top: -4px;
}

.portal-lang .lang {
  background: rgba(22, 82, 57, 0.06);
  border-color: rgba(22, 82, 57, 0.15);
  color: var(--navy);
  font-size: 0.8rem;
  height: 42px;
  width: 42px;
}

@media (max-width: 991px) {
  .nav-bell {
    width: 100%;
    border-radius: 50px;
  }

  .portal-lang {
    justify-content: center;
  }
}

/* Stats */
.stat-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.stat-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

.stat-card .icon-bubble {
  border-radius: 12px;
}

.stat-card .stat-value {
  color: var(--navy);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

/* Tables */
.portal-table {
  margin: 0;
}

.portal-table thead th {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.9rem 1rem;
  white-space: nowrap;
}

.portal-table td {
  border-color: var(--line);
  padding: 0.9rem 1rem;
  vertical-align: middle;
}

.portal-table .ref {
  color: var(--navy);
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.ref-inline {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  unicode-bidi: isolate;
}

/* Mobile: tables become stacked cards */
@media (max-width: 767.98px) {
  .portal-table.stack thead {
    display: none;
  }

  .portal-table.stack tr {
    border-bottom: 1px solid var(--line);
    display: block;
    padding: 0.75rem 0;
  }

  .portal-table.stack td {
    border: none;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.3rem 1rem;
  }

  .portal-table.stack td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .portal-table.stack td.actions::before {
    content: none;
  }

  .portal-table.stack td.actions {
    justify-content: flex-end;
  }
}

.status-badge {
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4em 0.85em;
  white-space: nowrap;
}

/* Timeline (status history / updates) */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  background: var(--line);
  bottom: 6px;
  content: "";
  inset-inline-start: 7px;
  position: absolute;
  top: 6px;
  width: 2px;
}

.timeline li {
  padding-bottom: 1.1rem;
  padding-inline-start: 2rem;
  position: relative;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  background: #fff;
  border: 3px solid var(--gold);
  border-radius: 50%;
  content: "";
  height: 16px;
  inset-inline-start: 0;
  position: absolute;
  top: 3px;
  width: 16px;
}

.timeline .tl-title {
  color: var(--navy);
  font-weight: 700;
}

.timeline .tl-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline .tl-note {
  background: var(--paper);
  border-radius: 10px;
  font-size: 0.9rem;
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  white-space: pre-line;
}

/* Detail list */
.detail-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-list dd {
  color: var(--ink);
  margin-bottom: 1rem;
}

.case-description {
  background: var(--paper);
  border-radius: 12px;
  line-height: 1.9;
  padding: 1rem 1.25rem;
  white-space: pre-line;
}

/* Message thread */
.thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 560px;
  overflow-y: auto;
  padding: 0.25rem;
}

.msg {
  border-radius: 16px;
  max-width: 85%;
  padding: 0.9rem 1.1rem;
}

.msg .msg-meta {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  opacity: 0.8;
}

.msg .msg-body {
  white-space: pre-line;
  word-break: break-word;
}

.msg.mine {
  align-self: flex-end;
  background: var(--navy);
  border-end-end-radius: 4px;
  color: #fff;
}

.msg.theirs {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-end-start-radius: 4px;
}

.msg.info-request {
  border: 2px solid var(--gold);
}

.msg .msg-files a {
  color: inherit;
  display: inline-flex;
  font-size: 0.85rem;
  gap: 0.3rem;
  margin-top: 0.5rem;
  margin-inline-end: 0.75rem;
  text-decoration: underline;
}

/* Documents */
.doc-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
}

.doc-item + .doc-item {
  margin-top: 0.6rem;
}

.doc-item .doc-icon {
  color: var(--gold);
  font-size: 1.5rem;
}

.doc-item .doc-name {
  color: var(--navy);
  font-weight: 700;
  word-break: break-all;
}

.doc-item .doc-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Updates feed */
.update-item {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  color: inherit;
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
}

.update-item:last-child {
  border-bottom: none;
}

.update-item:hover .update-title {
  color: var(--gold-dark);
}

.update-item .update-title {
  color: var(--navy);
  font-weight: 700;
}

.update-item .update-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.update-item.unread {
  background: rgba(203, 150, 45, 0.06);
  border-radius: 10px;
  padding-inline: 0.75rem;
}

.empty-state {
  color: var(--muted);
  padding: 2.5rem 1rem;
  text-align: center;
}

.empty-state i {
  color: rgba(203, 150, 45, 0.6);
  display: block;
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
}

/* Alerts */
.portal-alert {
  border: none;
  border-radius: 14px;
  border-inline-start: 4px solid;
}

.portal-alert.alert-success {
  background: #eef7f2;
  border-color: var(--navy);
  color: var(--navy);
}

.reference-highlight {
  background: #fff;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  color: var(--navy);
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0.25rem 0;
  padding: 0.2rem 0.8rem;
}

/* Compact portal footer */
.portal-footer {
  background: linear-gradient(90deg, var(--navy), var(--navy-soft));
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

.portal-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.portal-footer a:hover {
  color: var(--gold);
}

.legal-content li {
  line-height: 1.9;
  margin-bottom: 0.75rem;
}

.pagination .page-link {
  color: var(--navy);
}

.pagination .page-item.active .page-link {
  background: var(--navy);
  border-color: var(--navy);
}
