:root {
  --navy: #0f1729;
  --deep: #0b1220;
  --cyan: #22c0cf;
  --sky: #74dcff;
  --ink: #172236;
  --muted: #667085;
  --line: #e1e7ef;
  --surface: #f7f9fc;
  --white: #ffffff;
  --success: #14a673;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(15, 23, 41, .16);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.login-page {
  background: var(--deep);
  color: var(--white);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 44px clamp(38px, 6vw, 88px) 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 12% 88%, rgba(34, 192, 207, .27), transparent 30%),
    radial-gradient(circle at 92% 10%, rgba(116, 220, 255, .2), transparent 28%),
    linear-gradient(145deg, #080e1a, #101a2d 70%, #102936);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  pointer-events: none;
  background-image: radial-gradient(rgba(116,220,255,.45) .7px, transparent .7px);
  background-size: 24px 24px;
}

.brand-logo-wrap, .brand-message, .brand-status { position: relative; z-index: 1; }
.brand-logo-wrap { width: 230px; padding: 10px 14px; border-radius: 14px; background: var(--sky); }
.brand-logo { display: block; width: 100%; height: auto; }

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.eyebrow.dark { color: #128c9d; }
.brand-message { max-width: 580px; }
.brand-message h1, .login-card h2, .welcome-row h1, .browser-heading h2, .dialog-header h2 {
  margin: 0;
  font-family: Sora, Inter, "Segoe UI", sans-serif;
  letter-spacing: -.04em;
}
.brand-message h1 { font-size: clamp(2.7rem, 5vw, 5.4rem); line-height: 1.02; font-weight: 650; }
.brand-message p { max-width: 530px; margin: 24px 0 0; color: #c5cedb; font-size: 1.1rem; }
.brand-status { display: flex; align-items: center; gap: 10px; color: #cbd5e1; font-size: .9rem; }
.brand-status span { width: 9px; height: 9px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 0 5px rgba(34,192,207,.14); }

.login-panel {
  min-height: 100vh;
  padding: 48px clamp(28px, 8vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--surface);
  color: var(--ink);
}
.login-card { width: min(100%, 460px); }
.mobile-logo { display: none; }
.login-card h2 { font-size: clamp(2rem, 4vw, 3.2rem); color: var(--navy); line-height: 1.08; }
.login-intro { margin: 16px 0 32px; color: var(--muted); }
.alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #f4b4af; border-radius: 10px; color: var(--danger); background: #fff3f2; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 8px; font-weight: 700; color: #344054; font-size: .9rem; }
.login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #cdd5df;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34,192,207,.14); }
.password-field { position: relative; }
.password-field input { padding-right: 86px; }
.password-toggle { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 10px; border: 0; background: transparent; color: #247a88; font-size: .84rem; font-weight: 750; cursor: pointer; }
.primary-button {
  margin-top: 18px;
  min-height: 54px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(110deg, #159baa, var(--cyan));
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(34,192,207,.22);
}
.primary-button:hover { filter: brightness(1.04); }
.security-note { margin: 22px 0 0; color: #7a8798; text-align: center; font-size: .82rem; }
.security-note span { color: var(--cyan); }
.support-link { position: absolute; bottom: 25px; color: #667085; font-size: .85rem; text-decoration: none; }
.support-link:hover { color: #128c9d; }

.portal-page { background: var(--surface); }
.topbar {
  height: 78px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--deep);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(15,23,41,.15);
}
.topbar-brand { width: 168px; padding: 6px 10px; border-radius: 9px; background: var(--sky); }
.topbar-brand img { display: block; width: 100%; }
.topbar-actions { display: flex; align-items: center; gap: 24px; }
.client-identity { display: flex; align-items: center; gap: 10px; }
.client-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(34,192,207,.18); color: var(--sky); font-weight: 800; }
.client-identity > span:last-child { display: grid; line-height: 1.15; }
.client-identity small { color: #aeb8c7; font-size: .7rem; }
.client-identity strong { font-size: .9rem; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: #cbd5e1; cursor: pointer; }
.text-button:hover { color: var(--white); }

.portal-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 50px 0 38px; }
.welcome-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.welcome-row h1 { color: var(--navy); font-size: clamp(2rem, 4vw, 3.1rem); }
.welcome-row p { margin: 8px 0 0; color: var(--muted); }
.support-pill { padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: #475467; text-decoration: none; font-size: .85rem; }
.support-pill:hover { border-color: var(--cyan); color: #127b89; }

.summary-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.summary-card { min-height: 154px; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: 0 8px 24px rgba(15,23,41,.04); }
.summary-icon { float: right; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #e9fbfd; color: #128c9d; font-weight: 900; }
.summary-copy { display: grid; gap: 6px; }
.summary-copy span { color: var(--muted); font-size: .84rem; }
.summary-copy strong { color: var(--navy); font-family: Sora, Inter, sans-serif; font-size: 1.45rem; }
.summary-card small { color: #8792a2; font-size: .75rem; }
.progress-track { height: 6px; margin: 22px 0 9px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #159baa, var(--cyan)); transition: width .5s ease; }
.status-card small { display: flex; align-items: center; gap: 7px; margin-top: 24px; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--success); }

.browser-card { border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 12px 32px rgba(15,23,41,.05); overflow: hidden; }
.browser-heading { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.browser-heading h2, .dialog-header h2 { color: var(--navy); font-size: 1.25rem; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; color: #7b8798; font-size: .78rem; }
.breadcrumbs button { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.breadcrumbs button:hover { color: #128c9d; }
.breadcrumbs button[aria-current="page"] { color: #344054; font-weight: 700; }
.secondary-button { min-height: 38px; padding: 0 14px; border: 1px solid #cfd7e2; border-radius: 8px; background: var(--white); color: #344054; font-weight: 700; font-size: .82rem; text-decoration: none; cursor: pointer; }
.secondary-button:hover { border-color: var(--cyan); color: #127b89; }
.secondary-button.compact { min-height: 34px; display: inline-flex; align-items: center; }
.browser-message { margin: 18px 24px 0; padding: 11px 13px; border-radius: 8px; color: var(--danger); background: #fff3f2; }
.table-wrap { overflow-x: auto; }
.files-table { width: 100%; border-collapse: collapse; }
.files-table th { padding: 13px 24px; color: #667085; background: #f8fafc; text-align: left; font-size: .75rem; letter-spacing: .03em; text-transform: uppercase; }
.files-table td { padding: 15px 24px; border-top: 1px solid #edf1f5; color: #5b6676; font-size: .88rem; }
.files-table th:last-child, .files-table td:last-child { text-align: right; }
.file-name { min-width: 210px; display: inline-flex; align-items: center; gap: 11px; color: #243148; font-weight: 700; }
button.file-name { padding: 0; border: 0; background: none; cursor: pointer; }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: #eef5f8; color: #298698; }
.folder-icon { background: #e7fafc; color: #128c9d; }
.row-action { margin-left: 12px; padding: 0; border: 0; background: transparent; color: #128c9d; font-weight: 750; font-size: .8rem; text-decoration: none; cursor: pointer; }
.row-action:hover { text-decoration: underline; }
.loading-row, .empty-row { height: 110px; text-align: center !important; color: #7c8796 !important; }
.load-more { display: block; margin: 0 auto 20px; }
.load-more[hidden] {display: none;}
.session-note { margin: 18px 0 0; color: #8a94a3; text-align: center; font-size: .75rem; }

.versions-dialog { width: min(620px, calc(100% - 30px)); max-height: min(720px, calc(100vh - 30px)); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: var(--shadow); }
.versions-dialog::backdrop { background: rgba(11,18,32,.7); backdrop-filter: blur(3px); }
.dialog-header { padding: 22px 24px; display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-header .eyebrow { margin-bottom: 5px; }
.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f1f4f7; color: #475467; font-size: 1.35rem; cursor: pointer; }
.versions-content { padding: 8px 24px 24px; overflow: auto; }
.version-row { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf1f5; }
.version-row > div { display: grid; gap: 3px; }
.version-row strong { color: #243148; }
.version-row span { color: #7a8595; font-size: .8rem; }
.version-marker { color: #9a6700 !important; }
.dialog-loading, .dialog-error { padding: 26px 0; text-align: center; color: #667085; }
.dialog-error { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .login-panel { padding-top: 35px; padding-bottom: 75px; }
  .mobile-logo { display: block; width: 210px; margin: 0 0 40px; padding: 9px 12px; border-radius: 12px; background: var(--sky); }
  .mobile-logo img { display: block; width: 100%; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .usage-card { grid-column: span 2; }
}

@media (max-width: 640px) {
  .topbar { height: 68px; padding: 0 16px; }
  .topbar-brand { width: 132px; }
  .client-identity > span:last-child { display: none; }
  .topbar-actions { gap: 14px; }
  .portal-main { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .welcome-row { align-items: start; }
  .support-pill { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .usage-card { grid-column: auto; }
  .browser-heading { padding: 18px; }
  .files-table th, .files-table td { padding-left: 16px; padding-right: 16px; }
  .files-table th:nth-child(2), .files-table td:nth-child(2) { display: none; }
  .actions-cell { white-space: nowrap; }
  .versions-content, .dialog-header { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
