/* frontend/public/style.css */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #c82121;  /* warm red background */
  color: #222;
}

/* Header: thin black logo bar + red title bar */
header {
  position: relative;
  margin: 0;
  padding: 32px 1rem 12px 1rem;   /* top padding leaves room under logo strip */
  background-color: #c82121;      /* red title bar */
  color: #ffffff;
  text-align: center;
}

/* Thin black bar at the top with logo */
header::before {
   content: "";
  position: absolute;
  left: 0rem;              /* distance from left edge */
  top: 15%;
  transform: translateY(-50%);
  height: 32px;           /* just under bar height */
  width: 100%;            /* <-- add explicit width so it’s visible */
  background-color: #000000;
  background-image: url("/sglogo.png");  /* logo in black bar */
  background-repeat: no-repeat;
  background-position: 1rem center;      /* logo near left edge */
  background-size: auto 32px;            /* scale logo to fit strip */
}

/* Title and subtitle styling */
header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

header p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
}


main {
  padding: 0.75rem;
  max-width: 700px;
  margin: 0 auto;
}

.card {
  background-color: rgba(255, 255, 255, 0.9);  /* 90% opaque white */
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.card h3 {
  margin-top: 0.75rem;
  font-size: 1rem;
}

.schedule-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);  /* 7-day week view */
  gap: 0.25rem;
}

.schedule-day {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
  min-height: 80px;
  font-size: 0.8rem;
  background: #fff;
}

.schedule-day-header {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.schedule-day-today {
  border-color: #FFB000;
  box-shadow: 0 0 0 1px #FFB000;
}

.schedule-entry {
  margin-bottom: 0.2rem;
}
.schedule-entry-time {
  font-weight: 600;
}
.schedule-entry-ref {
  display: block;
}

.signature-pad {
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  touch-action: none; /* helps with touch drawing */
}
#signatureCanvas {
  width: 100%;
  height: auto;
  display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  margin-top: 0.5rem;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.offline-banner {
  background-color: #ffe0a3;
  color: #5c3b00;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.sync-controls {
  margin-top: 1rem;
  text-align: center;
}

#syncNowBtn {
  background-color: #f43256;  /* strong red/pink */
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

#syncNowBtn:hover {
  background-color: #c92441;  /* darker on hover */
}

#syncNowBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.buttons {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

button {
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #004a7f;
  color: #fff;
}

button.secondary {
  background-color: #666;
}

button#stopDictation {
  background-color: #a00;
}

button#submitBtn {
  width: 100%;
  font-weight: bold;
  background-color: #28a745;
}

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

.status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.status.success {
  color: #1e7e34;
}

.status.error {
  color: #a00;
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.3rem;
}

footer {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: #666;
}

/* Layout helpers */

.visit-header-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .visit-header-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.job-ref-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.docs-row {
  align-items: center;
}

.documents-panel {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background-color: #f0f4ff;
  border: 1px solid #c7d2ff;
}

.documents-panel h3 {
  margin-top: 0;
  font-size: 1rem;
}

.documents-panel ul {
  list-style: none;
  padding-left: 0;
  margin: 0.25rem 0 0;
}

.documents-panel li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.documents-panel a {
  color: #004a7f;
  text-decoration: none;
}

.documents-panel a:hover {
  text-decoration: underline;
}

.radio-row {
  display: flex;
  gap: 1rem;
  margin: 0.3rem 0 0.5rem;
}

/* Admin page reuse */

.admin-container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 0 0.75rem;
}

.admin-card {
  background-color: #fff;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* ===========================
   Product checklist modal
   =========================== */

.modal {
  position: fixed;
  inset: 0;                  /* top:0; right:0; bottom:0; left:0; */
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  display: none;             /* JS sets this to 'flex' when opened */
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 600px;
  width: 95%;
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.checklist-section ol {
  padding-left: 1.25rem;
}

.checklist-section li {
  margin-bottom: 0.5rem;
}

.checklist-section label {
  margin-right: 0.75rem;
}

/* Page background image, lightly washed out on all pages */
body {
  position: relative;
  background-color: #f5f5f5;  /* keep existing base colour */
  color: #222;
  margin: 0;
}

/* Semi-transparent background image layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;                    /* top:0; right:0; bottom:0; left:0 */
  z-index: -1;                 /* stay behind all content */
  background-image: url("/bckgnd.jpeg");
  background-size: cover;      /* fill the screen */
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;               /* adjust between 0 (invisible) and 1 (solid) */
  pointer-events: none;        /* don't block clicks/touches */
}

/* Telephone + Email on one line */
.contact-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;          /* allows stacking on very narrow screens */
  align-items: center;
}

.contact-field {
  flex: 1 1 0;              /* both fields share the row */
}

.contact-field label {
  display: block;
  margin-bottom: 0.25rem;
}
/* Ask Kev block on customer page */
.ask-kev {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.ask-kev-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #004a7f;
}

img[src*="kev3.png"] {
  width: 80px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.ask-kev-text {
  font-size: 1rem;
}