@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
    --ink: #16181d;
    --ink-soft: #22252c;
    --ink-softer: #2c2f38;
    --paper: #f7f5f1;
    --paper-dim: #efece5;
    --copper: #c2703a;
    --copper-bright: #e08a4f;
    --steel: #6b7688;
    --steel-light: #9aa3b0;
    --line: rgba(255, 255, 255, 0.09);
    --line-dark: rgba(22, 24, 29, 0.1);
    --success: #3d8361;
    --success-bg: #e4f2eb;
    --danger: #c24b3a;
    --danger-bg: #fbe9e6;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Cylinder band - the signature element ---------- */
.cylinder-band {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 34px;
    overflow: hidden;
    opacity: 0.55;
}
.cylinder-band span {
    flex: 1;
    background: var(--copper);
    border-radius: 1px;
    min-width: 2px;
    max-width: 4px;
}

/* ============================================================
   Auth screens (login / register / change password)
   ============================================================ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(194,112,58,0.10), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(194,112,58,0.08), transparent 40%);
    padding: 32px 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px 32px 32px;
    color: #fff;
    animation: rise 0.5s ease both;
}
.auth-card.wide { max-width: 640px; }
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}
.auth-brand-mark {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--copper);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 15px;
    flex-shrink: 0;
}
.auth-brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.auth-brand-sub { font-size: 11.5px; color: var(--steel-light); margin-top: 1px; }

.auth-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; margin: 0 0 6px; }
.auth-subtitle { font-size: 14px; color: var(--steel-light); margin: 0 0 26px; line-height: 1.5; }

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--steel-light);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--ink-softer);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #fff;
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.field input::placeholder { color: #5a6070; }
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--copper);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { font-size: 12px; color: var(--steel-light); margin-top: 5px; }
.field-error { font-size: 12px; color: #ff8a7a; margin-top: 5px; min-height: 0; }
.field-error:empty { display: none; }

.pw-wrap { position: relative; }
.pw-toggle {
    position: absolute;
    right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--steel-light);
    font-size: 12px; font-weight: 500; padding: 4px;
}
.pw-toggle:hover { color: #fff; }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--copper);
    color: var(--ink);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14.5px;
    margin-top: 8px;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--copper-bright); }

.auth-footer-note {
    text-align: center;
    font-size: 13px;
    color: var(--steel-light);
    margin-top: 20px;
}
.auth-footer-note a { color: var(--copper-bright); text-decoration: none; font-weight: 500; }
.auth-footer-note a:hover { text-decoration: underline; }

.auth-band-wrap { margin: 26px 0 22px; }

.form-error {
    background: var(--danger-bg);
    color: #7a2c1f;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 18px;
}
.form-success {
    background: var(--success-bg);
    color: #1f5a3d;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.field-section-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--copper-bright);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 22px 0 14px;
}
.field-section-title:first-child { margin-top: 0; }

/* ============================================================
   Dashboard shell
   ============================================================ */
.portal-header {
    background: var(--ink);
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-nav-desktop { display: flex; align-items: center; gap: 6px; }
.hamburger-btn { display: none; background: none; border: none; color: #fff; padding: 8px; }
.hamburger-btn svg { width: 24px; height: 24px; display: block; }

.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 9px;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    padding: 7px 14px 7px 8px;
    border-radius: 30px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
}
.user-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--copper);
    color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
    flex-shrink: 0;
}
.user-menu-btn svg { width: 14px; height: 14px; opacity: 0.7; }
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 48px; right: 0;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 190px;
    padding: 6px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: #dfe1e6;
    text-decoration: none;
    border-radius: 6px;
}
.user-menu-dropdown a:hover { background: var(--ink-softer); color: #fff; }
.user-menu-dropdown a svg { width: 16px; height: 16px; opacity: 0.75; }
.user-menu-dropdown .divider { height: 1px; background: var(--line); margin: 6px 4px; }

/* Mobile slide-in nav */
.mobile-nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 78%; max-width: 300px;
    background: var(--ink-soft);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.mobile-nav-overlay.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-close { background: none; border: none; color: #fff; padding: 8px; margin-bottom: 10px; }
.mobile-nav-panel .user-line { display: flex; align-items: center; gap: 10px; padding: 10px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.mobile-nav-panel a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 10px;
    color: #dfe1e6;
    text-decoration: none;
    font-size: 15px;
    border-radius: 8px;
}
.mobile-nav-panel a:hover { background: var(--ink-softer); }
.mobile-nav-panel a svg { width: 18px; height: 18px; opacity: 0.75; }

/* ---------- Hero ---------- */
.portal-hero {
    background: var(--ink);
    color: #fff;
    padding: 56px 24px 0;
    text-align: center;
}
.portal-hero-inner { max-width: 640px; margin: 0 auto; }
.portal-hero-eyebrow {
    font-size: 12.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: var(--copper-bright); margin-bottom: 14px;
}
.portal-hero h1 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 14px;
}
.portal-hero h1 span { color: var(--copper-bright); }
.portal-hero p {
    font-size: 15.5px;
    color: var(--steel-light);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto 14px;
}
.portal-hero p:last-of-type { margin-bottom: 0; }
.portal-hero .cylinder-band { margin: 40px auto 0; max-width: 640px; }

/* ---------- Content ---------- */
.portal-content { max-width: 1000px; margin: 0 auto; padding: 36px 24px 60px; }
.portal-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}
.portal-section-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0; }
.portal-section-head .count { font-size: 13px; color: var(--steel); }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-num { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.stat-label { font-size: 12.5px; color: var(--steel); margin-top: 4px; }

/* ---------- Job cards ---------- */
.job-grid { display: grid; gap: 12px; }
.job-card-row {
    background: #fff;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s;
}
.job-card-row:hover { border-color: var(--copper); transform: translateX(2px); }
.job-card-main { min-width: 0; }
.job-card-no { font-family: var(--font-mono); font-size: 13px; color: var(--copper); font-weight: 500; }
.job-card-name { font-size: 15px; font-weight: 500; margin: 3px 0 2px; }
.job-card-date { font-size: 12.5px; color: var(--steel); }
.job-card-status {
    flex-shrink: 0;
    font-size: 12px; font-weight: 600;
    padding: 6px 13px;
    border-radius: 20px;
    white-space: nowrap;
}
.status-progress { background: #e7edf7; color: #2a4a8e; }
.status-dispatch { background: #fbeedd; color: #8a5518; }
.status-finished { background: var(--success-bg); color: #1f5a3d; }
.status-cancelled { background: var(--danger-bg); color: #7a2c1f; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--steel);
}
.empty-state svg { width: 40px; height: 40px; opacity: 0.35; margin-bottom: 14px; }

/* ---------- Job detail ---------- */
.detail-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13.5px; color: var(--steel); text-decoration: none; margin-bottom: 18px;
}
.detail-back:hover { color: var(--copper); }
.detail-back svg { width: 14px; height: 14px; }
.detail-card { background: #fff; border: 1px solid var(--line-dark); border-radius: 14px; padding: 28px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.detail-head h1 { font-family: var(--font-mono); font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.detail-head .job-name-line { font-size: 16px; color: var(--steel); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin: 24px 0; }
.detail-field-label { font-size: 12px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.detail-field-value { font-size: 15px; font-weight: 500; }
.detail-field-sub { font-size: 12.5px; font-weight: 400; color: var(--steel); }
.detail-image-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink); color: #fff;
    padding: 12px 22px; border-radius: 8px;
    text-decoration: none; font-weight: 500; font-size: 14px;
    margin-top: 10px;
    border: none;
}
.detail-image-btn:hover { background: var(--ink-soft); }
.detail-image-btn svg { width: 16px; height: 16px; }

.detail-etd {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--paper-dim);
    border-radius: var(--radius);
}
.detail-etd svg { width: 20px; height: 20px; color: var(--copper); flex-shrink: 0; }
.detail-etd-label { font-size: 12px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.4px; }
.detail-etd-value { font-size: 15px; font-weight: 500; margin-top: 2px; }

/* ---------- Pan/zoom design image modal ---------- */
.image-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10, 11, 14, 0.94);
    z-index: 300;
    flex-direction: column;
}
.image-modal-overlay.open { display: flex; }
.image-modal-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
}
.image-modal-hint { color: var(--steel-light); font-size: 12.5px; }
.image-modal-close { background: none; border: none; color: #fff; padding: 8px; }
.image-modal-close svg { width: 22px; height: 22px; display: block; }
.image-modal-viewport {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
}
.image-modal-viewport.dragging { cursor: grabbing; }
.image-modal-viewport img {
    max-width: 90%;
    max-height: 85vh;
    transition: transform 0.05s linear;
    user-select: none;
    -webkit-user-drag: none;
}
@media (max-width: 780px) {
    .image-modal-hint { font-size: 11px; }
}

/* ---------- Contact FAB ---------- */
.contact-fab {
    position: fixed;
    bottom: 22px; right: 22px;
    background: var(--copper);
    color: var(--ink);
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(194,112,58,0.4);
    z-index: 90;
}
.contact-fab svg { width: 24px; height: 24px; }
.contact-fab:hover { background: var(--copper-bright); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 780px) {
    .portal-nav-desktop { display: none; }
    .hamburger-btn { display: block; }
    .portal-hero h1 { font-size: 26px; }
    .field-row { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 22px 24px; }
    .job-card-row { flex-direction: column; align-items: flex-start; }
    .job-card-status { align-self: flex-start; }
    .detail-card { padding: 20px; }
}

/* ============================================================
   Home / landing page
   ============================================================ */
.home-body { background: var(--paper); }

.home-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
}
.home-nav-cta {
    background: var(--copper);
    color: var(--ink);
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
}
.home-nav-cta:hover { background: var(--copper-bright); }

.home-hero {
    background: var(--ink);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(194,112,58,0.10), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(194,112,58,0.08), transparent 40%);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 64px 32px;
}
.home-hero-copy { color: #fff; max-width: 560px; }
.home-hero-title {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 600;
    line-height: 1.18;
    margin: 14px 0 20px;
}
.home-hero-title span { color: var(--copper-bright); }
.home-hero-sub {
    font-size: 16px;
    color: var(--steel-light);
    line-height: 1.7;
    margin-bottom: 32px;
}
.home-stats-row { display: flex; gap: 32px; flex-wrap: wrap; }
.home-stat-num { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--copper-bright); }
.home-stat-label { font-size: 12.5px; color: var(--steel-light); margin-top: 2px; }

.home-login-wrap { display: flex; justify-content: center; }
.home-login-card { animation: none; width: 100%; max-width: 400px; }

.home-band { padding: 22px 0; background: var(--paper-dim); }

.home-section { padding: 72px 32px; }
.home-section-dark { background: var(--ink); }
.home-section-inner { max-width: 1080px; margin: 0 auto; }
.home-section-head { text-align: center; max-width: 560px; margin: 0 auto 44px; }
.home-section-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    margin: 10px 0 0;
}

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.home-feature-card {
    background: #fff;
    border: 1px solid var(--line-dark);
    border-radius: 14px;
    padding: 26px 22px;
}
.home-feature-icon {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--copper);
    border: 1px solid var(--copper);
    border-radius: 50%;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.home-feature-card h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; margin: 0 0 8px; }
.home-feature-card p { font-size: 13.5px; color: var(--steel); line-height: 1.6; margin: 0; }

.home-process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}
.home-process-card {
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 20px;
}
.home-process-num {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--copper-bright);
    margin-bottom: 10px;
}
.home-process-card h4 { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: #fff; margin: 0 0 8px; }
.home-process-card p { font-size: 13px; color: var(--steel-light); line-height: 1.6; margin: 0; }
.home-process-card-final {
    background: var(--copper);
    border-color: var(--copper);
}
.home-process-card-final .home-process-num,
.home-process-card-final h4 { color: var(--ink); }
.home-process-card-final p { color: var(--ink); }
.home-process-note { text-align: center; color: var(--steel-light); font-size: 13.5px; margin: 32px 0 0; }

.home-why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px 32px;
}
.home-why-item { display: flex; gap: 14px; align-items: flex-start; }
.home-why-item svg { width: 22px; height: 22px; color: var(--copper); flex-shrink: 0; margin-top: 2px; }
.home-why-item h4 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.home-why-item p { font-size: 13.5px; color: var(--steel); line-height: 1.6; margin: 0; }

.home-footer {
    background: var(--ink);
    color: var(--steel-light);
    text-align: center;
    padding: 44px 24px 32px;
}
.home-footer-name { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 15px; }
.home-footer-tagline { font-size: 12.5px; margin: 4px 0 18px; }
.home-footer-copyright { font-size: 11.5px; opacity: 0.6; }

@media (max-width: 900px) {
    .home-hero { grid-template-columns: 1fr; padding: 44px 20px; }
    .home-hero-title { font-size: 32px; }
    .home-nav { padding: 14px 18px; }
    .home-section { padding: 52px 20px; }
}

/* ============================================================
   Contact Us modal - light theme, scoped separately from the
   dark auth-card field styling used elsewhere on this page.
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 11, 14, 0.6);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal-box h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.contact-modal-sub { font-size: 13.5px; color: var(--steel); margin: 0 0 20px; }
.modal-close {
    position: absolute;
    top: 18px; right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--steel);
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--ink); }

#contact-modal .field label { color: var(--ink); font-size: 12.5px; font-weight: 600; }
#contact-modal .field input,
#contact-modal .field select,
#contact-modal .field textarea {
    background: #fff;
    border: 1px solid #ddd8ce;
    color: var(--ink);
}
#contact-modal .field input:focus,
#contact-modal .field textarea:focus {
    border-color: var(--copper);
    box-shadow: 0 0 0 2px rgba(194,112,58,0.15);
}
#contact-modal .field textarea { resize: vertical; min-height: 90px; }
#contact-modal .btn-primary { width: 100%; margin-top: 6px; }
.contact-success {
    text-align: center;
    padding: 20px 10px;
}
.contact-success svg { width: 44px; height: 44px; color: var(--success); margin-bottom: 12px; }
.contact-success p { color: var(--steel); font-size: 14px; }
