/* Team MEM shared styles: Melbourne Electrical Maintenance brand tokens, header, panels, buttons, forms.
   Page-specific styles go in each page. */

/* Melbourne Electrical Maintenance brand typeface: Montserrat (self-hosted, SIL OFL).
   Regular for body text, Bold for headings, Extra Bold for emphasis. */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand primary colours: Bright Cerulean and Firefly (navy) */
  --mem-blue: #0fa8e0;
  --mem-blue-dark: #0b87b6;
  --mem-blue-soft: #e7f6fc;
  /* Cerulean for text on white: Bright Cerulean itself is too light to read (2.6:1). */
  --mem-blue-text: #0877a3;
  --mem-navy: #0b223a;
  --mem-navy-dark: #071829;
  /* Brand secondary colours: Dove Grey (--muted) and Sunshade */
  --mem-sunshade: #f89c1c;
  /* Status accent (not a brand colour) */
  --mem-green: #2f7d4a;

  --bg: #f3f6f9;
  --card: #ffffff;
  --border: #dce3ea;
  --text: #0b223a;
  --muted: #6d6e70;
  --success-bg: #e8f0e3;
  --success-text: #3f5c31;
  --warning-bg: #fdf1dc;
  --warning-text: #8a5a06;
  --danger-bg: #fbe4e2;
  --danger-text: #a32a1f;
  --shadow: 0 10px 25px rgba(11, 34, 58, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 {
  font-weight: 700;
}

/* Header */
header {
  position: relative;
  overflow: hidden;
  background: var(--mem-navy);
  color: #fff;
  padding: 28px 24px 32px;
  border-bottom: 5px solid var(--mem-blue);
}

/* Angled cerulean block, echoing the brand graphics style. */
/* The slanted edge keeps the same 30° angle at any screen size or header height; only its
   position moves. --wedge-start is where the edge meets the bottom of the header. */
header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--wedge-start, 66%);
  width: 200%;
  background: var(--mem-blue);
  transform: skewX(-30deg);
  transform-origin: bottom left;
  pointer-events: none;
}

.header-inner,
main {
  max-width: 1200px;
  margin: 0 auto;
}

.header-inner {
  position: relative;
  z-index: 1;
}

main {
  padding: 24px;
}

.brand-home {
  display: inline-block;
}

/* Logo on the left, Home button on the right (app pages). */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.header-top .brand-logo {
  margin-bottom: 0;
}

.home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--mem-navy-dark);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: 0.15s ease;
}

.home-button svg {
  width: 18px;
  height: 18px;
  fill: var(--mem-blue);
}

.home-label-short {
  display: none;
}

.home-button:hover {
  background: var(--mem-blue-soft);
  transform: translateY(-1px);
}

.home-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
  margin-bottom: 22px;
}

.breadcrumb {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.breadcrumb a {
  color: #fff;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--mem-blue);
  text-decoration: underline;
}

.brand-title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-title .accent {
  color: var(--mem-blue);
}

.brand-subtitle {
  margin: 8px 0 0;
  color: rgba(255,255,255,0.86);
  font-weight: 500;
}

/* Panels and layout */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 22px;
}

.panel-meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
button,
.button-link {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  background: var(--mem-blue);
  color: var(--mem-navy-dark);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.15s ease;
}

button:hover,
.button-link:hover {
  background: var(--mem-blue-dark);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--mem-navy);
  color: #fff;
}

button.secondary:hover {
  background: var(--mem-navy-dark);
}

button.ghost {
  background: var(--mem-blue-soft);
  color: var(--mem-navy);
}

button.ghost:hover {
  background: #c8ebf8;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button:focus-visible,
.button-link:focus-visible {
  outline: 3px solid rgba(15,168,224,0.5);
  outline-offset: 2px;
}

/* Status messages */
.message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f9fb;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
}

.message.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #c8d9bd;
}

.message.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #f6d493;
}

.message.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #f3c0bb;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(15,168,224,0.22);
  border-color: var(--mem-blue);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* Job-based apps: step labels, job ID lookup and job details */
.step-label {
  margin: 0 0 4px;
  color: var(--mem-blue-text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.job-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

.job-form .field {
  flex: 1 1 240px;
}

.job-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  margin: 16px 0 0;
  padding: 16px;
  border-left: 4px solid var(--mem-blue);
  border-radius: 10px;
  background: #f7f9fb;
}

.job-details dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.job-details dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
  white-space: pre-line;
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 680px) {
  header {
    padding: 22px 18px 26px;
  }

  header::after {
    --wedge-start: 85%;
  }

  .header-inner {
    padding-right: 10%;
  }

  .brand-logo {
    height: 34px;
    margin-bottom: 16px;
  }

  .header-top {
    margin-bottom: 16px;
  }

  .home-button {
    padding: 9px 14px;
  }

  /* Keep the button short on phones: "Home" instead of "Team MEM home". */
  .home-label-full {
    display: none;
  }

  .home-label-short {
    display: inline;
  }

  .brand-title {
    font-size: 26px;
  }

  main {
    padding: 18px;
  }

  .toolbar,
  .toolbar button,
  .toolbar .button-link,
  .panel-heading > button {
    width: 100%;
  }

  .job-form button {
    width: 100%;
  }

  .job-details {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .job-details dd {
    margin-bottom: 10px;
  }
}
