/* NREDCAP EV Charging Land Application — styles
   Green branding matching the NREDCAP identity, modernised. */

:root {
    --green:        #7cb518;
    --green-dark:   #5c8a12;
    --green-darker: #4a6f0e;
    --ink:          #2b2b2b;
    --muted:        #6b7280;
    --line:         #e3e6e8;
    --bg:           #f4f6f4;
    --card:         #ffffff;
    --danger:       #d64545;
    --radius:       10px;
    --shadow:       0 2px 10px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--green-dark); }

/* ---- Top utility bar ---- */
.utility-bar {
    background: #eef1ee;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}
.utility-bar .wrap {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 7px 24px;
}
.utility-bar .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---- Official brand header (real logos + title) ---- */
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead .wrap {
    display: flex; align-items: center; gap: 22px;
    max-width: 1200px; margin: 0 auto; padding: 16px 24px 30px;
}
.masthead .mast-logo { height: 62px; width: auto; flex: 0 0 auto; }
.masthead .mast-emblem { height: 72px; width: auto; flex: 0 0 auto; }
.masthead .mast-title { flex: 1 1 auto; text-align: center; min-width: 0; }
.masthead .mast-title h1 {
    font-size: 19px; margin: 0 0 3px; line-height: 1.3;
    color: var(--green-darker); font-weight: 700;
}
.masthead .mast-title .sub { font-size: 12.5px; color: #555; }
.masthead .mast-title .sub-small { font-size: 12px; color: #333; font-weight: 600; margin-top: 2px; }

@media (max-width: 820px) {
    .masthead .wrap { flex-wrap: wrap; justify-content: center; gap: 12px; padding: 12px 14px; }
    .masthead .mast-logo { height: 48px; }
    .masthead .mast-emblem { height: 54px; }
    .masthead .mast-title { flex-basis: 100%; order: 3; }
    .masthead .mast-title h1 { font-size: 15px; }
    .masthead .mast-title .sub-small { font-size: 11px; }
}

/* ---- Nav ---- */
.mainnav {
    background: linear-gradient(90deg, var(--green), var(--green-dark));
}
.mainnav .wrap {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 0 16px;
    min-height: 44px;
}
.mainnav a {
    color: #fff; text-decoration: none;
    padding: 12px 16px; font-size: 13.5px; font-weight: 600;
    letter-spacing: .3px;
}
.mainnav a:hover, .mainnav a.active { background: rgba(0,0,0,.12); }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(rgba(74,111,14,.72), rgba(74,111,14,.72)),
                url("../images/hero.jpg") center/cover no-repeat, #4a6f0e;
    color: #fff; text-align: center;
    padding: 46px 24px;
}
.hero h2 { margin: 0; font-size: 24px; font-weight: 600; max-width: 820px; margin: 0 auto; }

/* ---- Layout ---- */
.container { max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { text-align: center; font-size: 22px; margin: 8px 0 4px; }
.mandatory-note { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.mandatory-note .req { color: var(--danger); }

/* ---- Card / sections ---- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 22px; overflow: hidden;
}
.section-head {
    background: #eef3e8; border-bottom: 1px solid var(--line);
    padding: 13px 18px; font-weight: 700; font-size: 14.5px;
    color: var(--green-darker); display: flex; align-items: center; gap: 10px;
}
.section-head .num {
    background: var(--green); color: #fff; width: 24px; height: 24px;
    border-radius: 50%; display: grid; place-items: center; font-size: 13px;
}
.section-body { padding: 20px 18px; }

/* ---- Form grid ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.field.full { grid-column: 1 / -1; }
.field label {
    display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px;
}
.field label .req { color: var(--danger); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }

input[type=text], input[type=email], input[type=tel], input[type=url],
input[type=number], input[type=password], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1px solid #cfd4d8; border-radius: 8px; background: #fff;
    font-family: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(124,181,24,.18);
}
textarea { resize: vertical; min-height: 76px; }

input[type=file] {
    width: 100%; font-size: 13px; padding: 8px;
    border: 1px dashed #c3c9cd; border-radius: 8px; background: #fafbfa;
}

.field .error-msg { color: var(--danger); font-size: 12.5px; margin-top: 5px; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .error-msg { display: block; }

/* Captcha */
.captcha-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha-img {
    border: 1px solid #cfd4d8; border-radius: 8px; height: 55px; width: 170px;
    background: #eef3e8; display: block;
}
.captcha-reload {
    width: 40px; height: 40px; border-radius: 8px; border: 1px solid #cfd4d8;
    background: #fff; cursor: pointer; font-size: 20px; color: var(--green-dark);
    line-height: 1; transition: background .15s;
}
.captcha-reload:hover { background: #eef3e8; }

/* Photo upload group */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-grid .field label { font-size: 12.5px; }

/* ---- Declaration ---- */
.declaration label {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 13.5px; padding: 8px 0; cursor: pointer;
}
.declaration input { margin-top: 3px; }
.declaration label.invalid span { color: var(--danger); }
#declError { margin-top: 6px; }

/* ---- Buttons ---- */
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.btn {
    padding: 11px 26px; font-size: 14px; font-weight: 600; border-radius: 8px;
    border: none; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #565d67; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }

/* ---- Alerts ---- */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fdecea; border: 1px solid #f5c2c0; color: #a12b2b; }
.alert-success { background: #eaf7e1; border: 1px solid #c2e6a5; color: #3f6b12; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }

/* ---- Footer ---- */
.site-footer {
    background: #2f3a27; color: #cdd7c2; text-align: center;
    padding: 22px; font-size: 13px; margin-top: 40px;
}

/* ---- Admin ---- */
.admin-topbar {
    background: var(--green-dark); color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 24px;
}
.admin-topbar a { color: #fff; }
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #eef3e8; color: var(--green-darker); font-weight: 700; white-space: nowrap; }
table.data tr:hover td { background: #f9fbf7; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data td.actions-cell { white-space: nowrap; text-align: right; }
table.data td.actions-cell .btn { padding: 5px 11px; font-size: 12px; margin-left: 4px; }
table.data .ref-cell { font-weight: 700; white-space: nowrap; }
.badge { padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-new { background: #fff3d6; color: #8a6d1a; }
.badge-reviewed { background: #e0efd4; color: #4a6f0e; }

.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(124,181,24,.25), transparent),
                radial-gradient(900px 500px at 110% 110%, rgba(74,111,14,.28), transparent),
                #eef2ea;
}
.login-card {
    width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr;
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(31,50,10,.18);
}
.login-hero {
    background: linear-gradient(150deg, var(--green), var(--green-dark) 55%, var(--green-darker));
    color: #fff; padding: 42px 38px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
/* subtle grid texture */
.login-hero::before {
    content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(120% 120% at 80% 0%, #000, transparent 70%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero .brand-row { display: flex; align-items: center; gap: 14px; }
.login-hero .logo-badge {
    width: 58px; height: 58px; border-radius: 14px; background: rgba(255,255,255,.16);
    display: grid; place-items: center; font-weight: 800; font-size: 13px; text-align: center;
    backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.28); line-height: 1.05;
}
.login-hero .brand-row .org { font-size: 12.5px; font-weight: 700; letter-spacing: .3px; line-height: 1.3; }
.login-hero .brand-row .org span { display: block; font-weight: 400; opacity: .8; font-size: 11px; }
.login-hero h3 { font-size: 23px; margin: 22px 0 10px; line-height: 1.25; }
.login-hero p.desc { font-size: 13px; color: rgba(255,255,255,.85); margin: 0 0 20px; line-height: 1.6; }
.login-hero ul.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.login-hero ul.features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.92); }
.login-hero ul.features svg { width: 18px; height: 18px; flex: 0 0 18px; }
.login-hero .foot {
    font-size: 11.5px; color: rgba(255,255,255,.72); margin-top: 26px;
    border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px;
    display: flex; align-items: center; gap: 8px;
}

.login-form { padding: 44px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form .eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--green-dark); margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.login-form .eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--green); border-radius: 2px; }
.login-form h2 { margin: 0 0 4px; color: #1f2937; font-size: 24px; }
.login-form .lead { color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }
.login-form .form-foot {
    margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--muted);
    border-top: 1px solid var(--line); padding-top: 18px;
}
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9aa4ab; }
.input-icon input { padding-left: 40px !important; }
.login-form .btn-primary { width: 100%; margin-top: 22px; padding: 13px; font-size: 15px; }
.pw-row { position: relative; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #8b949b; font-size: 12px; font-weight: 600; }

@media (max-width: 700px) {
    .login-card { grid-template-columns: 1fr; max-width: 420px; }
    .login-hero { display: none; }
}

.detail-grid { display: grid; grid-template-columns: 220px 1fr; gap: 0; }
.detail-grid dt { font-weight: 600; padding: 9px 14px; background: #f7f9f5; border-bottom: 1px solid var(--line); }
.detail-grid dd { margin: 0; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .grid, .photo-grid, .detail-grid { grid-template-columns: 1fr; }
    .masthead .wrap { flex-wrap: wrap; }
    .hero h2 { font-size: 20px; }
}

/* ---- Print header (only visible when printing) ---- */
.print-header { display: none; }

/* ---- Print styles: clean printout of one application ---- */
@media print {
    /* Hide everything that isn't the application content */
    .admin-topbar, .no-print, .doc-list li a, form { display: none !important; }

    body { background: #fff; color: #000; font-size: 12px; }
    .container { max-width: 100%; padding: 0; }

    .print-header {
        display: block; text-align: center; margin-bottom: 14px;
        border-bottom: 2px solid #4a6f0e; padding-bottom: 10px;
    }
    .print-header h1 { font-size: 16px; margin: 0 0 2px; color: #4a6f0e; }
    .print-header .org { font-size: 11px; color: #333; }
    .print-header .ref { font-size: 13px; font-weight: 700; margin-top: 6px; }

    .card {
        box-shadow: none; border: 1px solid #999; break-inside: avoid;
        page-break-inside: avoid; margin-bottom: 10px;
    }
    .section-head { background: #eef3e8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .detail-grid { grid-template-columns: 200px 1fr; }
    .detail-grid dt { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge { border: 1px solid #999; }
    a[href]:after { content: ""; } /* don't append URLs */
    .doc-list li { justify-content: flex-start; }
    .doc-list li strong:after { content: " — provided"; font-weight: 400; color: #444; }
}
