/* Malaysia Memilih — page-specific styles for login.html.
   Linked after the shared sheets (shell.css + component sheet) so these rules
   still override them, exactly as the previous inline <style> block did. */

:root {
  color-scheme: dark;
  --page: #080d16;
  --panel: #0e1523;
  --line: #202a3c;
  --muted: #8190a7;
  --red: #dc172b;
  --sky: #38bdf8;
  --teal: #166b68;
  --orange: #b96732;
  --emerald: #10b981;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: #e5eaf2;
  font-family: "Plus Jakarta Sans", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

/* ---------- Application frame ---------- */
.app {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 7px 12px;
  border: 1px solid #18202d;
  border-radius: 0;
  background: white;
  color: #18202d;
  text-decoration: none;
  font: 700 9px "JetBrains Mono", monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all .15s ease;
}

.header-button.active {
  background: #080d16;
  color: white;
}

.header-button:hover {
  background: #eef2f6;
  color: #080d16;
}

.header-button.active:hover {
  background: #182335;
  color: white;
}

.header-button.admin-button.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

/* ---------- Sign-in surface ---------- */
.login-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 48px;
  background:
    radial-gradient(
      ellipse at 50% 30%,
      #101b2a 0,
      #0b121d 52%,
      #070c14 92%
    );
}

.login-shell {
  width: 100%;
  max-width: 432px;
}

.login-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 60px #0008;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
}

.login-head {
  padding: 28px 28px 20px;
}

.login-eyebrow {
  font: 700 8px "JetBrains Mono", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}

.login-title {
  margin: 10px 0 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.login-sub {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: #7f90a9;
}

.login-body {
  padding: 4px 28px 28px;
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font: 600 9px "JetBrains Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a9ab2;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  color: #e5eaf2;
  background: #080f1b;
  border: 1px solid #2a354c;
  border-radius: 5px;
  font-size: 12px;
  outline: none;
  transition: border-color .15s ease;
}

.field input::placeholder { color: #56657e; }

.field input:hover { border-color: #384766; }

.field input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px #38bdf81f;
  outline: none;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 9px;
  border: 1px solid #2a354c;
  border-radius: 4px;
  background: #131c2b;
  color: #9fb0c8;
  font: 700 8px "JetBrains Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.password-toggle:hover { background: #1d293e; color: white; }

.field-hint {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: #71839e;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.7;
}

.alert-icon {
  flex: none;
  font-size: 12px;
  line-height: 1.4;
}

.alert.info {
  background: #14213a88;
  border: 1px solid #2c4468;
  color: #a8c6e8;
}

/* ---------- Submit Button / Link ---------- */
.submit-button {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #b21123;
  border-radius: 5px;
  background: var(--red);
  color: white;
  font: 700 10px "JetBrains Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(220, 23, 43, 0.35);
  transition: background .15s ease, transform .1s ease;
}

.submit-button:hover {
  background: #c21325;
  transform: translateY(-1px);
  color: white;
}

/* ---------- Card footer ---------- */
.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #263148;
  font-size: 10px;
  line-height: 1.8;
  color: #6b7c95;
}

.login-foot b { color: #93a4bc; font-weight: 600; }

.back-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font: 600 9px "JetBrains Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7dd3fc;
  text-decoration: none;
}

.back-link:hover { color: #b9e7f8; text-decoration: underline; }

/* ---------- Status bar ---------- */
.status-bar {
  flex: none;
  min-height: 31px;
  display: flex;
  align-items: stretch;
  gap: 12px;
  border-top: 1px solid #253044;
  background: #060a11;
  font: 9px "JetBrains Mono", monospace;
}

#statusText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-endpoint {
  margin-left: auto;
  color: #38bdf8;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .masthead {
    padding: 12px 14px;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-name { font-size: 13px; }
  .brand-note { font-size: 7px; letter-spacing: .04em; }
  .brand-bars { height: 24px; }

  .header-button {
    padding: 7px 8px;
    font-size: 8px;
    flex-shrink: 0;
  }

  .login-main { padding: 22px 14px 32px; align-items: flex-start; }
  .login-head { padding: 22px 20px 16px; }
  .login-body { padding: 4px 20px 22px; }
  .login-title { font-size: 17px; }

  .status-tag { padding: 8px; font-size: 7px; }
  .status-endpoint { display: none; }
}
