/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  background: #eef2f7;
  min-height: 100vh;
  padding: 24px;
  color: #1f2933;
}

/* Center ONLY non-agent pages */
body:not(.agent-page) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.agent-page .container {
  max-width: 720px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  padding: 42px 44px 46px;
  margin: 0 auto;
}

/* Divider ONLY for client cards */
body:not(.agent-page) .card::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    #e5e7eb,
    transparent
  );
  margin-bottom: 28px;
}

/* Login card should NOT have divider */
.login-card::before {
  display: none !important;
}

/* ─────────────────────────────────────────────
   HEADER / LOGO
───────────────────────────────────────────── */
.logo-container {
  text-align: center;
  margin-bottom: 22px;
}

.logo {
  display: inline-block;
  max-width: 180px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Agent header bar */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.logo-container-small img {
  max-width: 120px;
}

/* ─────────────────────────────────────────────
   HEADINGS
───────────────────────────────────────────── */
h1 {
  font-size: 30px;
  font-weight: 600;
  color: #003a8f;
  text-align: center;
  margin-bottom: 6px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  color: #003a8f;
  text-align: center;
  margin-bottom: 16px;
}

/* Agent page headings align left */
.agent-page h1,
.agent-page h2 {
  text-align: left;
}

/* ─────────────────────────────────────────────
   TEXT
───────────────────────────────────────────── */
.instruction {
  text-align: center;
  color: #4b5563;
  margin-bottom: 22px;
  line-height: 1.65;
  font-size: 15px;
}

.agent-page .instruction {
  text-align: left;
}

.status-text {
  text-align: center;
  font-size: 18px;
  color: #1f2933;
  margin-top: 22px;
  font-weight: 500;
}

.security-note {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 22px;
}

/* ─────────────────────────────────────────────
   INPUTS
───────────────────────────────────────────── */
.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
}

input:focus {
  outline: none;
  border-color: #003a8f;
  box-shadow: 0 0 0 3px rgba(0, 58, 143, 0.12);
}

#code-input {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  text-align: center;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn {
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #003a8f;
  color: #ffffff;
}

.btn-secondary {
  background: #6b7280;
  color: #ffffff;
}

.btn-link {
  background: none;
  color: #003a8f;
  padding: 0;
  font-size: 14px;
}

.btn-large {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────
   DOWNLOAD BUTTONS
───────────────────────────────────────────── */
.download-buttons {
  display: flex;
  gap: 18px;
  margin-bottom: 26px;
}

.btn-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px;
  width: 100%;
  background: #f9fafb;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  text-decoration: none;
  color: #1f2933;
}

.file-size {
  font-size: 12px;
  color: #6b7280;
}

/* SVG masks */
.download-icon {
  width: 36px;
  height: 36px;
  background-color: #003a8f;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.download-icon.windows {
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path fill='black' d='M2 8l20-3v18H2V8zm24-4l20-4v22H26V4zM2 26h20v18l-20-3V26zm24 0h20v22l-20-4V26z'/></svg>");
}

.download-icon.mac {
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'><path fill='black' d='M318.7 268.6c-.3-36.3 16.1-63.7 49.9-84.1-18.9-27.3-47.5-42.3-85.1-45.2-35.9-2.8-75 20.9-89.4 20.9-15.1 0-49.5-20-76.7-19.5-35.1.5-67.7 20.5-85.6 52-36.6 63.5-9.3 157.4 26.3 209 17.4 25.3 38.1 53.7 65.3 52.7 26.1-1 35.9-16.9 67.4-16.9 31 0 40.1 16.9 67.8 16.3 28-.4 45.7-25.5 62.9-50.9 19.9-29.2 28.1-57.4 28.4-58.9z'/></svg>");
}

/* ─────────────────────────────────────────────
   LOG / TERMINAL
───────────────────────────────────────────── */
.log-container {
  margin-top: 28px;
  background: #0f172a;
  border-radius: 8px;
  padding: 18px;
  max-height: 320px;
  overflow-y: auto;
}

.diagnostic-log {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #22c55e;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ─────────────────────────────────────────────
   SECURE INDICATOR
───────────────────────────────────────────── */
.secure-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #0f5132;
  margin-bottom: 26px;
}

.secure-dot {
  width: 10px;
  height: 10px;
  background: #16a34a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

/* ─────────────────────────────────────────────
   PENDING APPROVAL BOUNCE
───────────────────────────────────────────── */
@keyframes pendingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

#connecting-section.pending .logo {
  animation: pendingBounce 1.4s ease-in-out infinite;
}

/* ─────────────────────────────────────────────
   UTIL
───────────────────────────────────────────── */
.hidden {
  display: none !important;
}
