/* Standard Chartered branding for JupyterHub */

@font-face {
  font-family: 'SC Prosper Sans';
  src: url('SCProsperSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SC Prosper Sans';
  src: url('SCProsperSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SC Prosper Sans';
  src: url('SCProsperSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SC Prosper Sans';
  src: url('SCProsperSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --scb-bg: rgb(2, 11, 67);
  --scb-blue: #0473EA;
  --scb-green: #38D200;
  --scb-ink: #0b1220;
  --scb-muted: rgba(11, 18, 32, 0.72);
  --scb-page-bg: #f3f5f8;
  --scb-card-border: rgba(2, 11, 67, 0.08);
  --scb-shadow: 0 12px 32px rgba(2, 11, 67, 0.12);
  --scb-radius: 24px;
  --scb-radius-xl: 32px;
}

body.scb-theme {
  font-family: 'SC Prosper Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  background: var(--scb-page-bg);
}

/* Navbar */
body.scb-theme .scb-navbar {
  background: var(--scb-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body.scb-theme .scb-navbar .nav-link {
  color: rgba(255, 255, 255, 0.84) !important;
  font-weight: 500;
}

body.scb-theme .scb-navbar .nav-link:hover,
body.scb-theme .scb-navbar .nav-link:focus {
  color: #ffffff !important;
}

body.scb-theme .scb-navbar .dropdown-menu {
  border-radius: 16px;
  box-shadow: var(--scb-shadow);
}

body.scb-theme .scb-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

body.scb-theme .scb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

body.scb-theme .scb-brand-title {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
}

body.scb-theme .scb-brand-subtitle {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 400;
}

body.scb-theme .scb-logo svg {
  display: block;
  height: 28px;
  width: auto;
}

body.scb-theme .scb-logo svg .logo-lettering {
  fill: #ffffff;
}

body.scb-theme .scb-nav-btn {
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

body.scb-theme .scb-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.36) !important;
}

body.scb-theme .scb-user-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Content surfaces */
body.scb-theme .container {
  color: var(--scb-ink);
}

body.scb-theme .container:not(.announcement):not(.alert) {
  background: #ffffff;
  border-radius: var(--scb-radius-xl);
  border: 1px solid var(--scb-card-border);
  box-shadow: var(--scb-shadow);
  padding: 28px 32px;
}

body.scb-theme nav .container-fluid {
  background: transparent;
  box-shadow: none;
}

body.scb-theme .container.announcement {
  box-shadow: none;
  border-radius: 16px;
}

body.scb-theme a {
  color: #035fd0;
}

body.scb-theme a:hover {
  color: #024ba5;
}

/* Buttons */
body.scb-theme .btn-jupyter,
body.scb-theme .btn-primary,
body.scb-theme .scb-btn-primary {
  background: var(--scb-blue);
  border-color: var(--scb-blue);
  color: #ffffff;
  font-weight: 600;
  border-radius: 16px;
}

body.scb-theme .btn-danger,
body.scb-theme a.btn-danger {
  background: #d61f1f;
  border-color: #d61f1f;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 16px;
  text-decoration: none;
}

body.scb-theme .btn-danger:hover,
body.scb-theme a.btn-danger:hover {
  background: #b81515;
  border-color: #b81515;
  color: #ffffff !important;
}

body.scb-theme .btn-danger:focus,
body.scb-theme .btn-danger:focus-visible,
body.scb-theme a.btn-danger:focus,
body.scb-theme a.btn-danger:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(214, 31, 31, 0.18);
}

body.scb-theme .form-control {
  border-radius: 16px;
  border: 1px solid rgba(2, 11, 67, 0.14);
  padding: 12px 14px;
}

body.scb-theme .form-control:focus {
  border-color: rgba(4, 115, 234, 0.75);
  box-shadow: 0 0 0 0.22rem rgba(4, 115, 234, 0.18);
}

body.scb-theme .form-select {
  border-radius: 16px;
  border: 1px solid rgba(2, 11, 67, 0.14);
  padding: 12px 14px;
}

body.scb-theme .form-select:focus {
  border-color: rgba(4, 115, 234, 0.75);
  box-shadow: 0 0 0 0.22rem rgba(4, 115, 234, 0.18);
}

/* Spawn options */
body.scb-theme .scb-spawn-options__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

body.scb-theme .scb-spawn-options__hint {
  margin: 0;
  color: var(--scb-muted);
  max-width: 72ch;
}

body.scb-theme .scb-env-grid {
  display: grid;
  gap: 12px;
}

body.scb-theme .scb-env-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

body.scb-theme .scb-env-remove {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 20px;
  line-height: 1;
}

body.scb-theme .scb-env-note {
  color: rgba(2, 11, 67, 0.62);
}

@media (max-width: 640px) {
  body.scb-theme .scb-env-row {
    grid-template-columns: 1fr;
  }

  body.scb-theme .scb-env-remove {
    width: 100%;
  }
}

body.scb-theme .btn-jupyter:hover,
body.scb-theme .btn-primary:hover,
body.scb-theme .scb-btn-primary:hover {
  background: #035fd0;
  border-color: #035fd0;
  color: #ffffff;
}

  body.scb-theme .btn-jupyter:focus,
  body.scb-theme .btn-primary:focus,
  body.scb-theme .scb-btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(56, 210, 0, 0.22);
  }

  body.scb-theme .btn-outline-secondary,
  body.scb-theme .scb-btn-secondary {
    border-radius: 16px;
    border-color: rgba(2, 11, 67, 0.18);
    color: rgba(2, 11, 67, 0.82);
    font-weight: 600;
    background: transparent;
  }

  body.scb-theme .btn-outline-secondary:hover,
  body.scb-theme .scb-btn-secondary:hover {
    background: rgba(2, 11, 67, 0.04);
    border-color: rgba(2, 11, 67, 0.26);
    color: rgba(2, 11, 67, 0.92);
  }

  body.scb-theme .btn-outline-secondary:focus,
  body.scb-theme .scb-btn-secondary:focus {
    box-shadow: 0 0 0 0.22rem rgba(4, 115, 234, 0.14);
  }

  /* Error page */
  body.scb-theme .scb-error__content {
    display: grid;
    gap: 10px;
    text-align: center;
    justify-items: center;
  }

  body.scb-theme .scb-error__code {
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: rgba(2, 11, 67, 0.92);
    line-height: 1;
  }

  body.scb-theme .scb-error__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
  }

  body.scb-theme .scb-error__message {
    margin: 0;
    max-width: 60ch;
    color: var(--scb-muted);
  }

  body.scb-theme .scb-error__actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  /* Login page */
  body.scb-theme .scb-login {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 56px 16px;
    background: var(--scb-bg);
  }

body.scb-theme .scb-login__backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

body.scb-theme .scb-login__container {
  width: 100%;
  max-width: 480px;
  position: relative;
}

  body.scb-theme .scb-login__card {
    background: #ffffff;
    border-radius: var(--scb-radius-xl);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(2, 11, 67, 0.08);
    overflow: hidden;
  }

  body.scb-theme .scb-login__content {
    padding: 32px 32px 24px;
    color: var(--scb-ink);
  }

body.scb-theme .scb-login__logo svg {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  margin: 0 0 18px;
}

body.scb-theme .scb-login__logo svg .logo-lettering {
  fill: var(--scb-ink);
}

body.scb-theme .scb-login__headline {
  text-align: left;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
}

body.scb-theme .scb-login__subhead {
  text-align: left;
  margin: 0 0 22px;
  color: var(--scb-muted);
  max-width: 52ch;
}

body.scb-theme .scb-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
}

body.scb-theme .scb-alert--warning {
  background: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 193, 7, 0.35);
  color: rgba(0, 0, 0, 0.82);
}

body.scb-theme .scb-login__footer {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(2, 11, 67, 0.12);
  text-align: left;
  color: rgba(2, 11, 67, 0.62);
  font-size: 13px;
}

@media (max-width: 420px) {
  body.scb-theme .scb-brand-text {
    display: none;
  }
}
