/* ========================
   CSS CUSTOM PROPERTIES
   ======================== */
:root {
  --teal:        #3d6e7a;
  --dark-navy:   #1a2340;
  --red:         #e53935;
  --gold:        #c9a45a;
  --sage:        #7a9e8e;
  --sage-light:  #b8cfc7;
  --grey-card:   #c5c5c5;
  --brown:       #7a5c2a;
  --blue:        #3b7dd8;
  --green-check: #4CAF50;
  --text-main:   #1a1a1a;
  --text-muted:  #888;
  --border:      #e0e0e0;
  --bg:          #ffffff;
  --header-h:    64px;
  --radius:      10px;
  --font-main:   'Sora', sans-serif;
  --font-body:   'DM Sans', sans-serif;
}

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: var(--bg);
  min-height: 100vh;
  font-size: 14px;
}

/* ========================
   PAGE SYSTEM
   ======================== */
.page { display: none; flex-direction: column; min-height: 100vh; }
.page.active { display: flex; }

/* ========================
   HEADER
   ======================== */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 20px;
}

.header--landing {
  justify-content: space-between;
  border-bottom: none;
  padding: 24px 48px;
  height: auto;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
.logo-wordmark {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--dark-navy);
}
.logo-inline { display: flex; align-items: center; }
.logo-icon-sm {
  width: 36px; height: 36px;
  background: var(--dark-navy);
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 12px;
  margin-right: 8px;
}

/* Logo landing version */
.logo-text { font-family: var(--font-main); }
.logo-icon {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--dark-navy);
}
.logo-d { color: var(--dark-navy); }
.logo-apps { color: var(--dark-navy); }
.logo-con { color: var(--dark-navy); }

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: #fafafa;
}
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-main);
  flex: 1;
}
.header-search { flex: 1; max-width: 360px; }
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  color: var(--text-muted);
  display: flex; align-items: center;
}
.search-btn:hover { color: var(--text-main); }

/* Landing search */
.landing-search {
  width: 100%;
  max-width: 400px;
  border: none;
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  background: transparent;
  margin-top: 28px;
}
.landing-search input {
  font-size: 15px;
  padding: 6px 4px;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  position: relative;
}

.things-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-main);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.badge {
  background: var(--red);
  color: white;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  padding: 6px;
  border-radius: 6px;
  display: flex; align-items: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: #f0f0f0; }

.avatar-btn {
  background: none; border: none; cursor: pointer;
  position: relative;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

/* Wallet dropdown */
.wallet-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 50px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
}
.wallet-info {
  display: flex; align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.wallet-info-row {
  font-size: 13px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.wallet-addr { font-family: monospace; font-size: 12px; color: #444; }
.status-badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}
.status-badge.connected { color: #2e7d32; background: #e8f5e9; }
.status-badge.pending { color: #e65100; background: #fff3e0; }

/* ========================
   BUTTONS
   ======================== */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.btn--connect {
  background: var(--blue);
  color: white;
  padding: 12px 28px;
  font-size: 15px;
  border-radius: 12px;
}
.btn--connect:hover { background: #2e6ab8; transform: translateY(-1px); }

.btn--disconnect {
  width: 100%;
  background: none;
  border: 1.5px solid var(--red);
  color: var(--red);
  padding: 8px;
  font-size: 13px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-weight: 700;
}
.btn--disconnect:hover { background: var(--red); color: white; }

.btn--different {
  background: var(--red);
  color: white;
  padding: 16px 48px;
  font-size: 16px;
  border-radius: 32px;
}
.btn--different:hover { background: #c62828; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229,57,53,0.3); }

.btn--submit {
  background: var(--red);
  color: white;
  padding: 13px 40px;
  font-size: 14px;
  border-radius: 8px;
}
.btn--submit:hover { background: #c62828; }

.btn--back {
  background: var(--blue);
  color: white;
  padding: 16px 48px;
  font-size: 15px;
  border-radius: 32px;
  margin-top: 12px;
}
.btn--back:hover { background: #2e6ab8; transform: translateY(-1px); }

/* ========================
   LANDING PAGE
   ======================== */
.landing-main {
  flex: 1;
  padding: 32px 48px 40px;
}
.landing-hero {
  margin-bottom: 40px;
  /* center hero content horizontally */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.landing-sub {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.landing-title {
  font-family: var(--font-main);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-main);
}
.landing-title span { color: var(--text-main); }

/* Issue grid */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  /* try to take up most of the available horizontal space but cap size */
  width: 75%;          /* at least three quarters of the viewport */
  max-width: 1230x;    /* prevents it from stretching too wide on very large screens */
  min-width: 400px;    /* avoids collapsing too much on narrower desktops */
  /* center the grid within its parent container */
  margin: 0 auto;
}
.issue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  gap: 12px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.issue-card:hover { filter: brightness(0.9); transform: scale(0.98); }
.issue-card span {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: white;
  line-height: 1.3;
}
.card-icon { font-size: 36px; }

/* Card color variants */
.card--teal       { background: var(--teal); }
.card--light      { background: #e8e8e8; }
.card--light span { color: var(--text-main); }
.card--red        { background: var(--red); }
.card--dark       { background: var(--dark-navy); }
.card--sage       { background: var(--sage); }
.card--gold       { background: var(--gold); }
.card--sage-light { background: var(--sage-light); }
.card--sage-light span { color: var(--text-main); }
.card--dark2      { background: #3a4a7a; }
.card--brown      { background: var(--brown); }
.card--grey       { background: var(--grey-card); }
.card--grey span  { color: var(--text-main); }

/* ========================
   DASHBOARD PAGE
   ======================== */
.favourite-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 32px;
  font-size: 12px;
  color: #999;
  border-bottom: 1px solid #f0f0f0;
}

.dashboard-main { flex: 1; padding: 0; }

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 16px;
}
.section-title {
  font-family: var(--font-main);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wallet-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.progress-label { color: #555; }
.progress-pct { font-weight: 700; color: var(--text-main); }

/* attachment preview thumbnails */
.attachment-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-preview img,
.attachment-preview video { max-width: 100px; width:100px; max-height: 100px; object-fit: cover; border: 1px solid #ccc; }
.progress-bar {
  width: 200px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #66BB6A);
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Access grid */
.access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  margin: 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
}
.access-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
  gap: 8px;
}
.access-card:hover { background: #f8f8f8; }
.access-card strong {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
}
.access-card span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.ac-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
  color: #555;
  margin-bottom: 4px;
}
.ac-icon.teams     { color: #1565c0; background: #e3f2fd; }
.ac-icon.mailbox   { color: #1565c0; background: #e3f2fd; }
.ac-icon.green     { color: #2e7d32; background: #e8f5e9; }
.ac-icon.red       { color: var(--red); background: #ffebee; }
.ac-icon.red-outline { color: var(--red); background: #fff0f0; }
.ac-icon.dark-outline{ color: #444; background: #f5f5f5; }
.ac-icon.dark-out2 { color: #333; background: #f0f0f0; }
.ac-icon.gold-out  { color: var(--gold); background: #fff8e1; }
.ac-icon.gold-out2 { color: #b8860b; background: #fffde7; }
.ac-icon.map       { color: #1565c0; background: #e3f2fd; }
.ac-icon.settings  { color: #555; background: #f5f5f5; }

.different-issue-wrap {
  display: flex;
  justify-content: center;
  padding: 32px;
}

/* ========================
   REPORT FORM PAGE
   ======================== */
.report-main { flex: 1; padding: 0; }
.report-layout {
  display: flex;
  gap: 32px;
  padding: 24px 40px;
}
.report-left { flex: 1; max-width: 620px; }
.report-right {
  display: flex;
  flex-direction: column;
  /* left-align the button within the right column */
  align-items: flex-start;
  padding-top: 0;
  min-width: 120px;
  /* push submit button down to bottom of the flex container */
  margin-top: auto;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.report-icon {
  width: 52px; height: 52px;
  border: 2.5px solid var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.report-title {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.report-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.report-desc {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 24px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  font-family: var(--font-main);
}
.label-hint { font-weight: 400; color: var(--text-muted); font-family: var(--font-body); }

.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: var(--text-main);
  resize: none;
}
.form-input:focus { border-color: var(--blue); }
.form-textarea { display: block; }
.phrase-textarea { height: 200px; }

.attach-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.attach-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
}
.attach-btn:hover { color: var(--text-main); }

/* ========================
   SUCCESS PAGE
   ======================== */
.success-main { flex: 1; }
.success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 32px;
  text-align: center;
}
.success-checkmark {
  margin-bottom: 28px;
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes pop-in {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check 0.4s 0.4s ease forwards;
}
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.success-text {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}

/* ========================
   FOOTER
   ======================== */
.footer {
  background: var(--dark-navy);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.footer-nav { display: flex; gap: 24px; }
.footer-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.footer-nav a:hover { color: white; }
.footer-copy { color: rgba(255,255,255,0.6); font-size: 12px; }

/* ========================
   MODAL
   ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 420px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slide-up 0.3s ease;
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-title {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.wallet-options { display: flex; flex-direction: column; gap: 10px; }
.wallet-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.wallet-option:hover {
  border-color: var(--blue);
  background: #f0f7ff;
}
.wallet-opt-icon { font-size: 22px; }

/* Tickets list styling */
.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.ticket-item {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #f9f9f9;
  font-family: var(--font-body);
  transition: background 0.15s;
  overflow: hidden;
}
.ticket-item:hover {
  background: #f0f7ff;
  cursor: pointer;
}
.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}
.ticket-header-left {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ticket-type {
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
  margin-bottom: 4px;
}
.ticket-date {
  font-size: 12px;
  color: var(--text-muted);
}
.ticket-status {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.ticket-details {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
  animation: slide-down 0.3s ease;
}
.ticket-description {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
@keyframes slide-down {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  cursor: pointer; font-size: 16px; color: #999;
}
.modal-close:hover { color: var(--text-main); }

/* ========================
   TOAST
   ======================== */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark-navy);
  color: white;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.3s ease;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Connecting / side alert */
.connect-alert {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.connect-alert.visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.connect-alert-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12); min-width: 260px;
}
.connect-spinner, .btn-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.08); border-top-color: var(--blue);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.connect-text strong { display:block; font-size:13px; color:var(--text-main); }
.connect-text .connect-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }

/* Button spinner inside connect button */
.btn--connect .btn-spinner { display: inline-block; vertical-align: middle; margin-right:8px; }

/* Mobile: make alert stretch and center near top */
@media (max-width: 600px) {
  .connect-alert { left: 12px; right: 12px; top: 12px; display: flex; justify-content: center; }
  .connect-alert-card { min-width: auto; width: 100%; padding: 10px 12px; }
  .connect-text strong { font-size: 14px; }
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 900px) {
  .issue-grid {
    grid-template-columns: repeat(2, 1fr);
    /* allow grid to scale on smaller screens and stay centered */
    width: 100%;
    min-width: auto;
    margin: 0 auto;
  }
  .access-grid { grid-template-columns: repeat(2, 1fr); margin: 0 16px; }
  .header--landing { padding: 16px 20px; }
  .landing-main { padding: 24px 20px; }
  .report-layout { padding: 16px 20px; flex-direction: column; }
  /* ensure submit stays at bottom and left-aligned on narrow devices */
  .report-right { order: 0; align-items: flex-start; margin-top: auto; }
}

@media (max-width: 600px) {
  .issue-grid { grid-template-columns: repeat(2, 1fr); }
  .access-grid { grid-template-columns: 1fr 1fr; }
  .header { padding: 0 16px; gap: 10px; }
  .things-action-btn { display: none; }
  .header-search { display: none; }
  .footer { flex-direction: column; gap: 12px; text-align: center; }
}

/* desktop tweaks */
@media (min-width: 901px) {
  /* increase card height by boosting vertical padding */
  .issue-card {
    padding: 56px 16px;
  }
}

/* Assistance floater */
.assist-floater {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 1200;
}
.assist-btn {
  background: var(--red);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.assist-btn:hover { transform: translateY(-2px); }

/* Assistance modal content tweaks */
.assist-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.assist-item { border-top: 1px solid var(--border); padding-top: 10px; }
.assist-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  padding: 6px 0;
}
.assist-answer { font-size: 13px; color: #444; margin-top: 6px; display: none; }

@media (max-width: 600px) {
  .assist-floater { right: 12px; bottom: 18px; }
  .assist-btn { padding: 10px 14px; font-size: 14px; }
}
