:root{
  --bg:#f5f6f7;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#d9dde3;
  --brand:#1d4ed8;
  --brand2:#0b5bd3;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 12px;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:var(--bg);
  color:var(--text);

  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* Page width */
.container{
  width:min(1100px, 92%);
  margin:0 auto;
}

/* Form wrapper */
.form-wrap{
  padding:18px 0 10px;
}

/* Card */
.form-card{
  max-width:900px;
  margin:0 auto;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:28px;
}

/* Titles */
.form-card h1{
  margin:0 0 6px;
  font-size:26px;
}

.form-card .sub{
  margin:0 0 20px;
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}

/* Two column layout */
.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

/* Field group */
.field{
  margin-bottom:16px;
}

label{
  display:block;
  font-weight:700;
  font-size:13px;
  margin-bottom:6px;
}

/* Inputs */
input, select, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 13px;
  font-size:14px;
  background:#fff;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}

/* Focus effect */
input:focus,
select:focus,
textarea:focus{
  border-color:#93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

textarea{
  min-height:120px;
  resize:vertical;
}

/* Button */
.btn{
  appearance:none;
  border:0;
  cursor:pointer;
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:12px;
}

.btn-primary{
  background:var(--brand);
  color:#fff;
}

.btn-primary:hover{
  background:var(--brand2);
}

/* Success message */
.success{
  margin-bottom:15px;
  padding:12px;
  border-radius:12px;
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
  font-weight:600;
  text-align:center;
}

/* Postal code highlight */
#postcode:focus{
  border:2px solid #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* Mobile responsive */
@media (max-width: 860px){
  .row{
    grid-template-columns: 1fr;
  }
}

/* Service tiles */
.service-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
  margin-top:10px;
}

.service-tile{
  position:relative;
  display:block;
  cursor:pointer;
  user-select:none;
}

.service-tile input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.service-tile .tile-inner{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease, background-color .15s ease;
  min-height:72px;
}

.service-tile:hover .tile-inner{
  border-color:#c9d2e1;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.service-tile:active .tile-inner{
  transform: translateY(1px);
}

.tile-emoji{
  width:40px;
  height:40px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  background:#f3f4f6;
  border:1px solid var(--border);
  flex: 0 0 40px;
}

.tile-text{ display:flex; flex-direction:column; line-height:1.15; }
.tile-title{ font-weight:800; font-size:14px; color:var(--text); }
.tile-sub{ margin-top:4px; font-size:12.5px; color:var(--muted); }

/* Selected state */
.service-tile input:checked + .tile-inner{
  border-color:#93c5fd;
  background:#eff6ff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12), 0 12px 22px rgba(0,0,0,0.08);
}

.service-tile input:checked + .tile-inner .tile-emoji{
  background:#dbeafe;
  border-color:#93c5fd;
}

/* Keyboard accessibility */
.service-tile input:focus-visible + .tile-inner{
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 860px){
  .service-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .service-grid{ grid-template-columns: 1fr; }
}

/* Label with tooltip */
.label-with-tip{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:700;
  font-size:13px;
}

/* Tooltip icon */
.tip{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:50%;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  background:#eef2ff;
  color:#1d4ed8;
  border:1px solid #dbeafe;
}

/* Tooltip bubble */
.tip-text{
  position:absolute;
  bottom:130%;
  left:50%;
  transform:translateX(-50%) translateY(6px);
  width:220px;
  background:#111827;
  color:#fff;
  padding:8px 10px;
  border-radius:8px;
  font-size:12.5px;
  line-height:1.4;
  text-align:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
  z-index:20;
}

/* Arrow */
.tip-text::after{
  content:"";
  position:absolute;
  top:100%;
  left:50%;
  transform:translateX(-50%);
  border-width:6px;
  border-style:solid;
  border-color:#111827 transparent transparent transparent;
}

/* Hover + keyboard focus */
.tip:hover .tip-text,
.tip:focus .tip-text{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* Preference row */
.pref-row{
  margin: 6px 0 14px;
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  padding:12px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.pref-label{
  display:flex;
  align-items:flex-start;
  gap:10px;
  cursor:pointer;
  user-select:none;
}

.pref-label input[type="checkbox"]{
  margin-top:3px; /* aligns with text */
  width:16px;
  height:16px;
}

.pref-text{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.pref-title{
  font-weight:800;
  font-size:14px;
  color:var(--text);
  line-height:1.2;
}

.pref-sub{
  font-size:12.5px;
  color:var(--muted);
  line-height:1.35;
}

/* NAV / HEADER */
.nav{
  background:#fff;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:50;
}

.nav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 0;
}

/* LEFT SIDE GROUP */
.nav-left{
  display:flex;
  align-items:center;
  gap:14px;
}

/* USER NAME (near logo) */
.nav-user{
  font-size:14px;
  font-weight:600;
  color:#4b5563;
  padding-left:10px;
  border-left:1px solid #e5e7eb;
}

/* LOGOUT styling */
.nav-logout{
  color:#6b7280;
  font-weight:500;        /* lighter than others */
  opacity:0.75;           /* subtle */
  padding-left:8px;
  border-left:1px solid #e5e7eb; /* visual separation */
}

.nav-logout:hover{
  color:#1f2937;
  opacity:1;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  font-weight:800;
  font-size:18px;
  white-space:nowrap;
}

.badge{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  border:1px solid #dbeafe;
}

.nav-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.nav-links a{
  text-decoration:none;
  color:var(--text);
  font-weight:700;
  padding:8px 10px;
  border-radius:10px;
}

.nav-links a:hover{
  background:#f3f4f6;
}

@media (max-width: 520px){
  .nav-inner{ flex-direction:column; align-items:flex-start; }
  .nav-links{ width:100%; justify-content:flex-start; }
}

label.label-with-tip{ display:flex; }

.main-content{
  flex:1;
  padding:24px 0 18px;
}

.site-footer{
  background:#fff;
  border-top:1px solid var(--border);
  padding:28px 0 18px;
  margin-top:18px;
}

.footer-grid{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:40px;
}

.site-footer h4{
  margin-bottom:10px;
  font-size:14px;
  font-weight:800;
}

.site-footer ul{
  list-style:none;
  padding:0;
  margin:0;
}

.site-footer li{
  margin-bottom:6px;
  font-size:13px;
  color:var(--muted);
}

.site-footer a{
  text-decoration:none;
  color:var(--text);
}

.footer-bottom{
  margin-top:30px;
  padding-top:15px;
  border-top:1px solid var(--border);
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

@media(max-width:860px){
  .footer-grid{
    grid-template-columns:1fr;
  }
}

.hero{
  padding:44px 0 26px;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap:18px;
  align-items:stretch;
}

.hero h1{
  margin:0 0 10px;
  font-size:34px;
  line-height:1.15;
}

.hero p{
  margin:0 0 18px;
  color:var(--muted);
  font-size:15px;
  line-height:1.6;
}

.cta-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn-ghost{
  background:#f3f4f6;
  color:var(--text);
  border:1px solid var(--border);
}

.btn-ghost:hover{
  background:#e9edf2;
}

.kpi{
  display:grid;
  gap:10px;
}

.kpi .k{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
}

.k strong{
  display:block;
  font-size:18px;
  margin-bottom:2px;
}

.k span{
  color:var(--muted);
  font-size:13px;
}

.section{
  padding:18px 0 36px;
}

.section h2{
  margin:0 0 14px;
  font-size:22px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.card h3{
  margin:0 0 6px;
  font-size:16px;
}

.card p{
  margin:0;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.5;
}

.pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fafafa;
  color:#374151;
}

.email-exists-box{
    background:#fff3f3;
    border:1px solid #ffb3b3;
    padding:14px;
    border-radius:10px;
    margin-top:10px;
    color:#b10000;
}

.email-exists-box .btn{
    margin-top:8px;
    display:inline-block;
}

.status-card {
    margin-top: 20px;
    padding: 22px;
    border-radius: 14px;
}

.status-pending {
    border-left: 5px solid #f59e0b;
}

.status-selected {
    border-left: 5px solid #22c55e;
}

.status-closed {
    border-left: 5px solid #ef4444;
}

.job-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.job-heading h3 {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-open {
    background: #e7f0ff;
    color: #1d4ed8;
}

.status-assigned {
    background: #fff3cd;
    color: #8a5a00;
}

.status-completed {
    background: #dff7e7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.job-actions form {
    margin: 0;
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
    border: none;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.flash-message {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 600;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
}

/* Prevent links styled as buttons from being underlined */
.btn{
  text-decoration:none;
}

/* Job dashboard buttons should align neatly in the action row */
/* Make links and button elements match without making them larger */
.job-actions .btn{
  margin-top:0;
  font-family:inherit;
  font-size:14px;
  line-height:normal;
  text-decoration:none;
}

.footer-disclaimer {
  font-size: 11px;
  line-height: 1.4;
  color: #6b7280;
  text-align: center;
  max-width: 950px;
  margin: 12px auto 0;
  padding: 0 18px;
}

@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
}

/* =========================================================
Homeowner Job Details Page
========================================================= */

.back-link{
display:inline-flex;
align-items:center;
margin:0 0 14px;
color:var(--brand);
font-size:14px;
font-weight:700;
text-decoration:none;
}

.back-link:hover{
text-decoration:underline;
}

.job-detail-card{
background:var(--card);
border:1px solid var(--border);
border-radius:var(--radius);
box-shadow:0 2px 10px rgba(0,0,0,0.04);
padding:28px;
}

.job-detail-header{
display:flex;
align-items:flex-start;
justify-content:space-between;
gap:20px;
padding-bottom:22px;
border-bottom:1px solid var(--border);
}

.job-detail-header h1{
margin:0;
font-size:34px;
line-height:1.15;
}

.job-detail-description{
margin:12px 0 0;
max-width:760px;
color:var(--muted);
font-size:16px;
line-height:1.55;
}

.job-detail-pills{
display:flex;
flex-wrap:wrap;
gap:9px;
margin-top:18px;
}

.assignment-section,
.assignment-history-section,
.interested-students-section{
margin-top:28px;
}

.section-heading-row{
display:flex;
align-items:flex-end;
justify-content:space-between;
gap:14px;
margin-bottom:14px;
}

.section-heading-row h2{
margin:0;
font-size:23px;
}

.eyebrow{
margin:0 0 4px;
color:var(--muted);
font-size:12px;
font-weight:800;
letter-spacing:.05em;
text-transform:uppercase;
}

.assignment-card{
border-radius:14px;
padding:21px;
}

.assignment-card-live{
background:#f0fdf4;
border:1px solid #bbf7d0;
border-left:5px solid #22c55e;
}

.assignment-card-latest{
background:#fafafa;
border:1px solid var(--border);
border-left:5px solid #94a3b8;
}

.assignment-person,
.interest-card-top{
display:flex;
align-items:center;
gap:13px;
}

.assignment-person{
margin-bottom:19px;
}

.assignment-avatar{
width:46px;
height:46px;
flex:0 0 46px;
display:flex;
align-items:center;
justify-content:center;
border:1px solid #86efac;
border-radius:50%;
background:#dcfce7;
color:#166534;
font-size:18px;
font-weight:800;
}

.assignment-avatar-blue{
border-color:#bfdbfe;
background:#dbeafe;
color:#1d4ed8;
}

.assignment-person h3,
.interest-card h3{
margin:0 0 3px;
font-size:19px;
}

.assignment-person p,
.interest-card-top p{
margin:0;
color:var(--muted);
font-size:13px;
}

.assignment-contact-grid,
.assignment-summary-grid{
display:grid;
grid-template-columns:repeat(3, minmax(0, 1fr));
gap:13px;
}

.assignment-contact-grid > div,
.assignment-summary-grid > div{
padding:12px;
border-radius:11px;
background:rgba(255,255,255,.72);
}

.assignment-card-live .assignment-contact-grid > div{
border:1px solid #bbf7d0;
}

.assignment-card-latest .assignment-summary-grid > div{
border:1px solid var(--border);
}

.contact-label{
display:block;
margin-bottom:5px;
color:#4b5563;
font-size:12px;
font-weight:800;
}

.assignment-contact-grid a,
.assignment-contact-grid strong,
.assignment-summary-grid strong{
color:var(--text);
font-size:14px;
text-decoration:none;
}

.assignment-contact-grid a:hover{
text-decoration:underline;
}

.no-assignment-card{
padding:22px;
border:1px dashed var(--border);
border-radius:14px;
background:#fafafa;
}

.no-assignment-card h3{
margin:0 0 6px;
font-size:17px;
}

.no-assignment-card p{
margin:0;
color:var(--muted);
line-height:1.5;
}

.assignment-history-grid{
display:grid;
grid-template-columns:repeat(2, minmax(0, 1fr));
gap:14px;
}

.history-assignment-card{
padding:18px;
border:1px solid var(--border);
border-radius:14px;
background:#fff;
}

.history-label{
display:inline-block;
margin-bottom:12px;
padding:5px 9px;
border-radius:999px;
background:#f3f4f6;
color:#4b5563;
font-size:11px;
font-weight:800;
}

.history-assignment-card h3{
margin:0 0 10px;
font-size:18px;
}

.history-reason{
display:inline-block;
margin-bottom:11px;
padding:5px 9px;
border:1px solid #fde68a;
border-radius:999px;
background:#fef3c7;
color:#92400e;
font-size:12px;
font-weight:800;
}

.history-assignment-card p{
margin:5px 0 0;
color:var(--muted);
font-size:13px;
}

.interest-count{
padding:6px 10px;
border:1px solid #bfdbfe;
border-radius:999px;
background:#eff6ff;
color:#1d4ed8;
font-size:12px;
font-weight:800;
}

.student-interest-grid{
display:grid;
grid-template-columns:repeat(3, minmax(0, 1fr));
gap:14px;
}

.interest-card{
display:flex;
flex-direction:column;
gap:16px;
min-height:250px;
padding:18px;
border:1px solid var(--border);
border-radius:14px;
background:#fff;
}

.interest-contact-list{
flex:1;
}

.interest-contact-list p{
margin:7px 0 0;
color:var(--muted);
font-size:13px;
overflow-wrap:anywhere;
}

.interest-contact-list strong{
color:var(--text);
}

.interest-actions .btn{
width:100%;
margin-top:0;
font-family:inherit;
font-size:14px;
line-height:normal;
text-decoration:none;
}

@media (max-width:860px){
.assignment-contact-grid,
.assignment-summary-grid,
.assignment-history-grid,
.student-interest-grid{
grid-template-columns:1fr;
}
}

@media (max-width:620px){
.job-detail-card{
padding:20px;
}

.job-detail-header{
flex-direction:column;
}

.job-detail-header h1{
font-size:28px;
}
}

.phone-sharing-field {
    margin-top: 18px;
    margin-bottom: 22px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin: 0;
    flex-shrink: 0;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;
    border: 1px solid #6b7280;
    border-radius: 50%;

    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;

    position: absolute;
    z-index: 20;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);

    width: 290px;
    padding: 10px 12px;

    background: #1f2937;
    color: #fff;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;

    transition: opacity 0.15s ease;
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);

    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.info-tooltip:hover .tooltip-text,
.info-tooltip:focus .tooltip-text,
.info-tooltip:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
}

