:root {
  --olive: #9ca469;
  --olive-light: #e6e8d9;
  --charcoal: #252d3a;
  --grey: #646363;
  --line: #e9edf2;
  --background: #fbfcfd;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--charcoal);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 66px;
  padding: 10px clamp(24px, 8vw, 180px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--charcoal); font-weight: 750; font-size: 18px; text-decoration: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.language-select, .employee-link { min-height: 34px; border: 1px solid #dde3ea; border-radius: 8px; background: #fff; color: #42516a; font-size: 13px; }
.language-select { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; }
.language-select span { color: var(--olive); font-size: 11px; font-weight: 800; }
.language-select select { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; opacity: 1; }
.employee-link { padding: 8px 12px; text-decoration: none; }
.employee-link:hover { border-color: var(--olive); color: var(--charcoal); }

main { flex: 1; }
.welcome { padding: clamp(42px, 7vw, 74px) 24px clamp(32px, 5vw, 54px); text-align: center; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--olive); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(34px, 4.5vw, 46px); letter-spacing: -.045em; }
.welcome > p:last-child { margin: 10px 0 0; color: #99a4b2; font-size: 16px; }

.portal-grid { width: min(1200px, calc(100% - 48px)); margin: 34px auto 72px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.portal-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px rgba(35, 52, 72, .035); transition: transform .18s ease, box-shadow .18s ease; }
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(35, 52, 72, .10); }
.card-image { position: relative; height: 184px; display: flex; align-items: end; padding: 18px; isolation: isolate; color: #fff; font-size: 21px; font-weight: 780; letter-spacing: -.035em; overflow: hidden; }
.card-image::before, .card-image::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.card-image::before { background: linear-gradient(125deg, var(--image-a), var(--image-b)); }
.card-image::after { background: linear-gradient(0deg, rgba(28, 35, 44, .62), transparent 72%); }
.applicant { --image-a: #64736f; --image-b: #b6ae83; }
.subcontractor { --image-a: #768a91; --image-b: #b26f40; }
.customer { --image-a: #90735c; --image-b: #5a6876; }
.sales { --image-a: #4f6872; --image-b: #85915e; }
.card-content { min-height: 194px; padding: 17px 16px 16px; display: flex; flex-direction: column; }
.card-content p { margin: 0; color: #5f7697; font-size: 14px; line-height: 1.65; }
.card-content button, .portal-button, .dialog-action { width: 100%; margin-top: auto; min-height: 38px; border: 0; border-radius: 8px; background: var(--olive); color: #fff; cursor: pointer; font: inherit; font-weight: 750; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; }
.portal-card:nth-child(even) .card-content button, .portal-card:nth-child(even) .portal-button { background: #656565; }
.card-content button:hover, .portal-button:hover, .dialog-action:hover { filter: brightness(.94); }
.session-user { color: #4a5464; font-size: 14px; }

footer { min-height: 58px; padding: 16px clamp(24px, 8vw, 180px); border-top: 1px solid var(--line); color: #9ba8b9; font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; gap: 18px; }
footer a { color: inherit; text-decoration: none; }

dialog { width: min(440px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 24px 80px rgba(17, 27, 41, .25); }
dialog::backdrop { background: rgba(22, 31, 42, .42); }
dialog h2 { margin: 0; font-size: 24px; }
dialog p:not(.eyebrow) { color: #61718a; line-height: 1.55; }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #6f7c8c; font-size: 24px; cursor: pointer; }
.dialog-action { width: auto; margin-top: 8px; padding: 0 18px; }

@media (max-width: 1000px) { .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 660px; } }
@media (max-width: 620px) { .topbar { padding: 10px 18px; } .brand span, .language-select { display: none; } .portal-grid { grid-template-columns: 1fr; width: min(370px, calc(100% - 36px)); } .card-image { height: 160px; } footer { flex-direction: column-reverse; padding: 16px 18px; } }
