/* onadva mailhub plugin styles. Uses the shared semantic tokens from tokens.css. */

/* Source badge in the message list */
.mh-src {
  display: inline-flex; align-items: center; height: 18px; margin-right: 7px; padding: 0 7px;
  border-radius: 999px; vertical-align: 1px;
  background: color-mix(in srgb, var(--mh-color, #6b7d75) 14%, transparent);
  color: color-mix(in srgb, var(--mh-color, #6b7d75) 78%, var(--text, #13281f));
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; line-height: 1;
}
[data-theme='dark'] .mh-src { color: color-mix(in srgb, var(--mh-color, #6b7d75) 60%, #fff); background: color-mix(in srgb, var(--mh-color, #6b7d75) 22%, transparent); }

/* Settings pages */
.mh-frame { padding: 0 !important; }
.mh-page { max-width: 860px; margin: 0 auto; padding: 28px 28px 48px; color: var(--text); font-family: var(--font-sans); }
.mh-hero { margin-bottom: 20px; }
.mh-eyebrow { display: block; margin-bottom: 8px; color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.mh-hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 750; letter-spacing: -0.03em; color: var(--text); }
.mh-hero p { margin: 0; max-width: 640px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.mh-card { margin-bottom: 18px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mh-card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 700; color: var(--text); }
.mh-empty { margin: 4px 0; color: var(--text-subtle); font-size: 14px; }

.mh-accounts { display: grid; gap: 10px; }
.mh-account { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mh-account-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--mh-color) 16%, transparent); color: var(--mh-color); font-size: 14px; font-weight: 800; }
.mh-account-info { min-width: 0; }
.mh-account-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.mh-account-title strong { font-size: 15px; color: var(--text); }
.mh-account-email { overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: 13px; }
.mh-account-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; color: var(--text-subtle); font-size: 12px; }
.mh-account-error { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.mh-account-actions { display: flex; gap: 6px; }
.mh-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.mh-pill:before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mh-pill-ok { background: var(--success-soft); color: var(--success); }
.mh-pill-syncing, .mh-pill-pending { background: var(--info-soft); color: var(--info); }
.mh-pill-syncing:before { animation: mh-pulse 1.2s ease-in-out infinite; }
.mh-pill-error { background: var(--danger-soft); color: var(--danger); }
.mh-pill-paused { background: var(--surface-sunken); color: var(--text-subtle); }
.mh-danger { color: var(--danger) !important; }
@keyframes mh-pulse { 50% { opacity: 0.3; } }

.mh-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.mh-form .mh-wide { grid-column: 1 / -1; }
.mh-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.mh-field > span { color: var(--text-muted); font-size: 12.5px; font-weight: 650; }
.mh-field input, .mh-field select {
  height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.mh-field input:focus, .mh-field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.mh-help { color: var(--text-subtle); font-size: 12.5px; line-height: 1.6; }
.mh-custom { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px 14px; margin: 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 14px; }
.mh-custom[hidden] { display: none; }
.mh-custom .mh-wide { grid-column: 1 / -1; }
.mh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mh-actions .btn-primary { height: 42px; padding: 0 20px; border-radius: 12px; }
.mh-feedback { color: var(--text-muted); font-size: 13px; }
.mh-feedback.is-ok { color: var(--success); }
.mh-feedback.is-error { color: var(--danger); }
.mh-state { margin: 0 0 14px; color: var(--text-muted); }
.mh-steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-muted); line-height: 1.9; font-size: 13.5px; }
.mh-qr-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 16px; }
.mh-qr-wrap canvas { border-radius: 14px; background: #fff; padding: 8px; box-shadow: var(--shadow-sm); }
.mh-secret { padding: 10px 12px; border-radius: 10px; background: var(--surface-sunken); color: var(--text); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.mh-totp .mh-field { max-width: 240px; }

@media (max-width: 640px) {
  .mh-page { padding: 18px 14px 40px; }
  .mh-form { grid-template-columns: 1fr; }
  .mh-account { grid-template-columns: 40px minmax(0, 1fr); }
  .mh-account-actions { grid-column: 1 / -1; }
  .mh-field input, .mh-field select { font-size: 16px; }
}

/* Settings menu icons for the two plugin sections (Elastic font icons) */
#settings-menu li.mailhub-accounts > a:before { content: '\f0e0'; }
#settings-menu li.mailhub-security > a:before { content: '\f3ed'; }

/* Hub login: no invitation signup link */
body.task-login .onadva-signup { display: none !important; }

/* Standalone two-step verification page */
.mh-verify-body {
  min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(70% 60% at 15% 0%, rgb(53 181 131 / 0.28), transparent 60%), #041613;
  color: #edf8f1; font-family: 'Inter', 'SF Pro Text', 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.mh-verify { width: 100%; max-width: 380px; padding: 32px; text-align: center; border: 1px solid rgb(178 240 207 / 0.2); border-radius: 26px; background: rgb(11 38 33 / 0.85); box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.75); }
.mh-verify img { border-radius: 16px; margin-bottom: 18px; }
.mh-verify .mh-eyebrow { color: #79dcab; }
.mh-verify h1 { margin: 0 0 8px; font-size: 22px; }
.mh-verify p { margin: 0 0 22px; color: #a7bdb3; font-size: 14px; }
.mh-otp { width: 100%; height: 56px; box-sizing: border-box; border: 1px solid rgb(178 240 207 / 0.25); border-radius: 14px; background: rgb(3 18 15 / 0.6); color: #edf8f1; font-size: 26px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.mh-otp:focus { outline: none; border-color: #79dcab; box-shadow: 0 0 0 3px rgb(121 220 171 / 0.22); }
.mh-verify button { width: 100%; height: 48px; margin-top: 14px; border: 0; border-radius: 14px; background: #79dcab; color: #052119; font-size: 15px; font-weight: 700; cursor: pointer; }
.mh-error { margin: 12px 0 0 !important; color: #ff8d82 !important; }
.mh-logout { display: inline-block; margin-top: 18px; color: #a7bdb3; font-size: 13px; }
