/* ─── Reset & tokens ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0e14;
  --surface: #151921;
  --surface-2: #1c2128;
  --border: #2d333b;
  --accent: #377dff;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --text-dim: #4a5568;
  --green: #3fb950;
  --red: #f85149;
  --radius: 8px;
  --font: "Open Sans", sans-serif;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* Subtle grid texture */
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}

/* Vignette to fade the grid at edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    transparent 40%,
    var(--bg) 100%
  );
  pointer-events: none;
}

/* ─── Top bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  /* Shimmer sweep */
  background: linear-gradient(
    90deg,
    #1e4ed8,
    var(--accent),
    #60a5fa,
    var(--accent),
    #1e4ed8
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
}

/* ─── Logo / header ──────────────────────────────────────────────────────── */
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Bot icon made purely from CSS */
.logo-mark svg {
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.logo-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Form heading ────────────────────────────────────────────────────────── */
.form-heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Field ──────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 16px;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.input-wrap {
  position: relative;
}
.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 40px 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.input::placeholder {
  color: var(--text-dim);
}
.input:focus {
  border-color: var(--accent);
}

/* Toggle visibility button */
.toggle-vis {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  border-radius: 4px;
  line-height: 0;
  transition: color 0.15s;
}
.toggle-vis:hover {
  color: var(--text-muted);
}

/* ─── Error message ──────────────────────────────────────────────────────── */
.err-msg {
  display: none;
  font-size: 12px;
  color: var(--red);
  background: rgba(248, 81, 73, 0.06);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-bottom: 16px;
  line-height: 1.4;
}
.err-msg.show {
  display: block;
}

/* ─── Submit button ──────────────────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) {
  background: #4d8eff;
  border-color: #4d8eff;
}
.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Loading spinner inside button */
.btn-submit .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
.btn-submit.loading .spinner {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Footer note ────────────────────────────────────────────────────────── */
.footer-note {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ============================================================
   MOBILE RESPONSIVE — style-login.css
   Append this block to the END of src/web/public/style-login.css
   ============================================================ */

@media (max-width: 767px) {
  /* ─── Card: centered, 90% width, edge padding ─────────────── */
  .card {
    max-width: 100%;
    width: 90%;
    padding: 28px 20px 24px;
    margin: 0 auto;
  }

  /* ─── Input fields: full width, bigger tap target ──────────── */
  .input {
    width: 100%;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    padding: 12px 40px 12px 12px;
  }

  /* ─── Submit button: full width, taller touch target ──────── */
  .btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  /* ─── Labels & headings: minor size adjustments ───────────── */
  .form-heading {
    font-size: 17px;
  }

  .form-sub {
    font-size: 12px;
    margin-bottom: 20px;
  }

  .field-label {
    font-size: 12px;
  }

  /* ─── Logo row: tighter spacing ───────────────────────────── */
  .logo-row {
    margin-bottom: 22px;
  }

  /* ─── Footer note ─────────────────────────────────────────── */
  .footer-note {
    margin-top: 20px;
  }

  /* ─── Error message ───────────────────────────────────────── */
  .err-msg {
    font-size: 12px;
    padding: 10px 12px;
  }
}
