/* ── STP Auth Plugin — Stile Form Login & Account ─────────────────────────── */

/* Reset e variabili */
.stp-login-wrap, .stp-account-wrap {
  --stp-bg:        #0d1117;
  --stp-card:      #161b22;
  --stp-border:    #30363d;
  --stp-text:      #f0f6fc;
  --stp-muted:     #8b949e;
  --stp-primary:   #388bfd;
  --stp-primary-h: #1f6feb;
  --stp-success:   #3fb950;
  --stp-danger:    #f85149;
  --stp-warning:   #d29922;
  --stp-radius:    10px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--stp-text);
}

/* ── Split-page layout (login + setup) ─────────────────────────────────────── */
.stp-page-wrap {
  display: flex;
  min-height: 100vh;
  background: #0d1117;
}

/* Left decorative panel */
.stp-page-left {
  width: 400px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #0a0e17 0%, #0e1c35 55%, #111d30 100%);
  border-right: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 44px;
  position: relative;
  overflow: hidden;
}
.stp-page-left::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(33,150,243,.15) 0%, transparent 70%);
  pointer-events: none;
}
.stp-page-left::after {
  content: '';
  position: absolute; bottom: -60px; left: -60px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,139,253,.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Right panel: form area */
.stp-page-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #0d1117;
}

/* Sidebar branding */
.stp-sidebar-logo { margin-bottom: 36px; }
.stp-sidebar-brand {
  display: block; font-size: 30px; font-weight: 800;
  color: #58a6ff; letter-spacing: 2px; line-height: 1;
}
.stp-sidebar-sub {
  display: block; font-size: 11px; color: #484f58;
  letter-spacing: 2px; text-transform: uppercase; margin-top: 4px;
}
.stp-sidebar-tagline {
  font-size: 21px; font-weight: 700; color: #f0f6fc;
  line-height: 1.35; margin: 0 0 36px;
}

/* Feature list */
.stp-sidebar-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.stp-sidebar-feature  { display: flex; align-items: flex-start; gap: 14px; }
.stp-sidebar-feature-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(56,139,253,.1); border: 1px solid rgba(56,139,253,.2);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stp-sidebar-feature-text strong {
  display: block; font-size: 13px; font-weight: 600; color: #e6edf3; margin-bottom: 2px;
}
.stp-sidebar-feature-text span { font-size: 12px; color: #8b949e; line-height: 1.4; }

/* Step list for setup sidebar */
.stp-sidebar-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.stp-sidebar-step  { display: flex; align-items: flex-start; gap: 14px; }
.stp-sidebar-step-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.stp-sidebar-step-text strong { display: block; font-size: 13px; font-weight: 600; color: #e6edf3; margin-bottom: 2px; }
.stp-sidebar-step-text span   { font-size: 12px; color: #8b949e; line-height: 1.4; }

/* App badges in sidebar */
.stp-sidebar-apps { margin-top: 32px; padding-top: 24px; border-top: 1px solid #21262d; }
.stp-sidebar-apps-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #484f58; margin: 0 0 12px; }
.stp-sidebar-app-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stp-sidebar-app-name { font-size: 13px; color: #8b949e; }

/* Override .stp-login-wrap when inside split layout */
.stp-page-right .stp-login-wrap {
  max-width: 420px; width: 100%; margin: 0; padding: 0;
}
/* Hide in-form logo when sidebar already shows branding */
.stp-page-right .stp-logo { display: none; }

/* ── Login wrap (standalone fallback) ──────────────────────────────────────── */
.stp-login-wrap {
  max-width: 440px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ── Responsive split layout ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .stp-page-left { width: 320px; padding: 40px 28px; }
  .stp-sidebar-tagline { font-size: 17px; }
}
@media (max-width: 680px) {
  .stp-page-wrap { flex-direction: column; min-height: 100vh; }
  .stp-page-left {
    width: 100%; padding: 28px 20px 24px;
    border-right: none; border-bottom: 1px solid #21262d;
  }
  .stp-page-left::before, .stp-page-left::after { display: none; }
  .stp-sidebar-features, .stp-sidebar-steps { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .stp-sidebar-feature, .stp-sidebar-step { flex: 1 1 140px; }
  .stp-sidebar-tagline { font-size: 15px; margin-bottom: 16px; }
  .stp-sidebar-apps { display: none; }
  .stp-page-right { padding: 28px 16px 40px; align-items: flex-start; justify-content: flex-start; }
  .stp-page-right .stp-login-wrap { max-width: 100%; }
}

.stp-step {
  background: var(--stp-card);
  border: 1px solid var(--stp-border);
  border-radius: 14px;
  padding: 36px 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* Logo */
.stp-logo { text-align: center; margin-bottom: 24px; }
.stp-logo img { height: 56px; margin-bottom: 8px; }
.stp-logo h1 {
  font-size: 22px; font-weight: 800;
  color: var(--stp-primary); letter-spacing: 1px; margin: 0;
}

.stp-step h2 {
  font-size: 18px; font-weight: 700; text-align: center;
  margin: 0 0 20px; color: var(--stp-text);
}

.stp-shield { font-size: 48px; text-align: center; margin-bottom: 12px; }
/* .stp-hint moved to account section */

/* Messaggi */
.stp-msg {
  padding: 12px 16px; border-radius: 8px; font-size: 13px;
  margin-bottom: 16px; line-height: 1.5;
}
.stp-msg-error   { background: rgba(248,81,73,.15); border: 1px solid rgba(248,81,73,.4); color: #f85149; }
.stp-msg-info    { background: rgba(56,139,253,.12); border: 1px solid rgba(56,139,253,.3); color: #79c0ff; }
.stp-msg-success { background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.3); color: #56d364; }

/* Campi */
.stp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.stp-field label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--stp-muted); font-weight: 600; }
.stp-field input,
.stp-field input:not([type="submit"]) {
  width: 100% !important;
  box-sizing: border-box !important;
  background: #0d1117 !important;
  border: 1px solid var(--stp-border) !important;
  border-radius: 8px !important;
  color: var(--stp-text) !important;
  font-size: 14px !important;
  padding: 11px 14px !important;
  transition: border-color .2s, box-shadow .2s !important;
  outline: none !important;
  -webkit-text-fill-color: var(--stp-text) !important;
  opacity: 1 !important;
}
.stp-field input:hover,
.stp-field input:focus {
  color: var(--stp-text) !important;
  -webkit-text-fill-color: var(--stp-text) !important;
  background: #0d1117 !important;
}
/* Autofill browser override */
.stp-field input:-webkit-autofill,
.stp-field input:-webkit-autofill:hover,
.stp-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--stp-text) !important;
  -webkit-box-shadow: 0 0 0 1000px #0d1117 inset !important;
  box-shadow: 0 0 0 1000px #0d1117 inset !important;
}
.stp-field input:focus {
  border-color: var(--stp-primary);
  box-shadow: 0 0 0 3px rgba(56,139,253,.2);
}
.stp-field-otp input {
  text-align: center; font-size: 28px; font-family: monospace;
  letter-spacing: .4em; padding: 14px;
}

/* Bottoni */
.stp-btn {
  display: block; width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--stp-primary-h), var(--stp-primary));
  color: #fff !important; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none !important; text-align: center;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  margin-top: 4px;
  box-sizing: border-box;
}
.stp-btn:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(56,139,253,.35); color: #fff !important; }
.stp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.stp-btn-ghost {
  background: transparent; border: 1px solid var(--stp-border);
  color: var(--stp-muted); margin-top: 10px; font-size: 13px;
}
.stp-btn-ghost:hover { border-color: var(--stp-primary); color: var(--stp-primary); box-shadow: none; }
.stp-btn-sm { width: auto; padding: 9px 20px; font-size: 13px; }
.stp-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stp-sub-btn,
.stp-sub-btn-full {
  padding: 11px 16px; font-size: 13px; margin-top: 0;
  border: 1px solid var(--stp-border); border-radius: 8px;
}
.stp-sub-btn { width: 100%; }
.stp-sub-btn-full { grid-column: 1 / -1; width: 100%; }
.stp-btn-warning { background: linear-gradient(135deg,#b45309,var(--stp-warning)); }
.stp-btn-success { background: linear-gradient(135deg,#166534,#16a34a); color:#fff; border-color:#16a34a; }
.stp-btn-success:hover { background: linear-gradient(135deg,#14532d,#15803d); }
.stp-btn-dashboard {
  background: linear-gradient(135deg,#1a3a5c,var(--stp-primary));
  padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
  white-space: nowrap;
}

/* Nome + Cognome affiancati nella registrazione */
.stp-reg-name-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 480px) { .stp-reg-name-row { grid-template-columns: 1fr; } }

/* Setup 2FA */
.stp-setup-wrap { max-width: 520px; }
.stp-qr-wrap { text-align: center; margin: 20px 0; }
.stp-qr-img { border: 4px solid var(--stp-border); border-radius: 10px; background: #fff; padding: 4px; }
.stp-secret-label { text-align: center; font-size: 13px; color: var(--stp-muted); }
.stp-secret {
  background: #0d1117; border: 1px solid var(--stp-border);
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
  letter-spacing: .15em; color: var(--stp-primary); user-select: all;
}

/* ── Account wrap ──────────────────────────────────────────────────────────── */
.stp-account-wrap { max-width: 960px; margin: 36px auto; padding: 0 20px; }

/* Hero header */
.stp-hero {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border: 1px solid var(--stp-border); border-radius: 16px;
  padding: 28px 32px; margin-bottom: 28px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.stp-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(33,150,243,.12) 0%, transparent 70%);
  pointer-events: none;
}
.stp-hero-left { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 0; }
.stp-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--stp-primary-h), var(--stp-primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 4px rgba(33,150,243,.2);
}
.stp-hero-info { min-width: 0; }
.stp-hero-name { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: #f0f6fc !important; text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: normal; overflow-wrap: break-word; word-break: break-word; }
.stp-hero-username { font-size: 13px; color: #8b949e !important; display: block; margin-bottom: 10px; overflow-wrap: break-word; word-break: break-all; }
.stp-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stp-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex-shrink: 1; width: 100%; justify-content: flex-end; }

.stp-plan-badge {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
}
.stp-plan-basic   { background: rgba(56,139,253,.2); color: #79c0ff; border: 1px solid rgba(56,139,253,.4); }
.stp-plan-premium { background: rgba(210,153,34,.2); color: #e3b341; border: 1px solid rgba(210,153,34,.4); }
.stp-plan-free    { background: rgba(139,148,158,.15); color: #8b949e; border: 1px solid #30363d; }
.stp-badge-2fa {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: rgba(63,185,80,.15); color: #56d364; border: 1px solid rgba(63,185,80,.3);
}

/* Grid */
.stp-account-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (max-width: 600px) {
  .stp-hero { flex-direction: column; align-items: flex-start; padding: 20px 18px; gap: 16px; }
  .stp-hero-left { width: 100%; }
  .stp-hero-info { min-width: 0; flex: 1; }
  .stp-hero-name { font-size: 18px; white-space: normal; }
  .stp-hero-actions { width: 100%; justify-content: stretch; }
  .stp-hero-actions .stp-btn { flex: 1; text-align: center; justify-content: center; font-size: 13px; padding: 10px 12px; }
  .stp-avatar-lg { width: 56px; height: 56px; font-size: 22px; }
}

@media (max-width: 680px) { .stp-account-grid { grid-template-columns: 1fr; } }

/* Card */
.stp-card {
  background: var(--stp-card); border: 1px solid var(--stp-border);
  border-radius: 14px; padding: 24px 26px;
  display: flex; flex-direction: column; gap: 0;
  transition: border-color .2s;
}
.stp-card:hover { border-color: rgba(33,150,243,.3); }
.stp-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--stp-border);
}
.stp-card-icon { font-size: 20px; line-height: 1; }
.stp-card h3 { font-size: 15px; font-weight: 600; margin: 0; color: var(--stp-text); }
.stp-card-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--stp-border); }
.stp-card-footer-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Info list (read-only) */
.stp-info-list { display: flex; flex-direction: column; }
.stp-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--stp-border); gap: 12px;
  font-size: 14px;
}
.stp-info-row:last-child { border-bottom: none; }
.stp-info-label { color: var(--stp-muted); flex-shrink: 0; }
.stp-info-value { color: var(--stp-text); font-weight: 500; text-align: right; word-break: break-word; }

/* Subscription rows */
.stp-status { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.stp-status-active      { background: rgba(63,185,80,.15);  color: #56d364; }
.stp-status-trialing    { background: rgba(56,139,253,.15); color: #79c0ff; }
.stp-status-past_due    { background: rgba(210,153,34,.15); color: #e3b341; }
.stp-status-cancelling  { background: rgba(210,153,34,.15); color: #e3b341; }
.stp-status-cancelled   { background: rgba(248,81,73,.15);  color: #f85149; }

/* 2FA status block */
.stp-2fa-status {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px; border-radius: 10px; margin-bottom: 4px;
}
.stp-2fa-on  { background: rgba(63,185,80,.07); border: 1px solid rgba(63,185,80,.2); }
.stp-2fa-off { background: rgba(248,81,73,.07); border: 1px solid rgba(248,81,73,.2); }
.stp-2fa-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.stp-2fa-on  .stp-2fa-dot { background: #56d364; box-shadow: 0 0 6px rgba(63,185,80,.6); }
.stp-2fa-off .stp-2fa-dot { background: #f85149; box-shadow: 0 0 6px rgba(248,81,73,.5); }
.stp-2fa-status strong { font-size: 14px; color: var(--stp-text); display: block; margin-bottom: 2px; }

/* Field hint */
.stp-field-hint { color: var(--stp-muted); font-size: 12px; margin-top: 4px; display: block; }
.stp-hint { color: var(--stp-muted); font-size: 13px; margin: 4px 0 0; }
.stp-hint-center { text-align: center; margin: 16px 0; }

.stp-status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* Registration success popup */
.stp-popup-success { border-color: rgba(63,185,80,.35) !important; }
.stp-popup-success .stp-popup-icon { font-size: 48px; }

/* Welcome popup */
.stp-popup-welcome {
  border-color: rgba(33,150,243,.4) !important;
  background: linear-gradient(160deg, #161b22 0%, #0d1117 100%) !important;
}
.stp-popup-welcome .stp-popup-icon { font-size: 52px; }
.stp-popup-welcome h3 { font-size: 22px; }

/* ── Recupera Password ──────────────────────────────────────────────────────── */
.stp-recover-wrap { text-align: center; margin-top: 14px; }
.stp-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--stp-muted); font-size: 13px; text-decoration: underline;
  text-underline-offset: 3px; transition: color .2s;
}
.stp-link-btn:hover, .stp-link-btn-active { color: var(--stp-primary); }
.stp-recover-box {
  margin-top: 16px; padding: 20px; text-align: left;
  background: rgba(33,150,243,.05); border: 1px solid rgba(33,150,243,.2);
  border-radius: 12px; animation: stp-slide-down .2s ease;
}
.stp-recover-desc {
  color: var(--stp-muted); font-size: 13px; margin: 0 0 16px; line-height: 1.6;
}
@keyframes stp-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tabs Login / Registrazione ─────────────────────────────────────────── */
.stp-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.stp-tab {
  flex: 1;
  background: transparent;
  border: 1px solid var(--stp-border);
  border-radius: 8px;
  color: var(--stp-muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 13px;
  text-align: center;
  transition: opacity .2s, transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.stp-tab:hover {
  border-color: var(--stp-primary);
  color: var(--stp-primary);
}
.stp-tab.stp-tab-active {
  background: linear-gradient(135deg, var(--stp-primary-h), var(--stp-primary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(56,139,253,.35);
}

/* ── Form registrazione ─────────────────────────────────────────────────── */

/* ── Override globale: tutti gli input dentro i wrapper del plugin ─────────── */
.stp-login-wrap input[type="text"],
.stp-login-wrap input[type="email"],
.stp-login-wrap input[type="password"],
.stp-login-wrap input[type="number"],
.stp-account-wrap input[type="text"],
.stp-account-wrap input[type="email"],
.stp-account-wrap input[type="password"],
.stp-account-wrap input[type="number"],
.stp-account-wrap select,
.stp-account-wrap textarea {
  color: #f0f6fc !important;
  -webkit-text-fill-color: #f0f6fc !important;
  background-color: #0d1117 !important;
  opacity: 1 !important;
}
.stp-login-wrap input[type="text"]:focus,
.stp-login-wrap input[type="email"]:focus,
.stp-login-wrap input[type="password"]:focus,
.stp-account-wrap input[type="text"]:focus,
.stp-account-wrap input[type="email"]:focus,
.stp-account-wrap input[type="password"]:focus,
.stp-account-wrap select:focus,
.stp-account-wrap textarea:focus {
  color: #f0f6fc !important;
  -webkit-text-fill-color: #f0f6fc !important;
  background-color: #0d1117 !important;
}
/* Placeholder */
.stp-login-wrap ::placeholder,
.stp-account-wrap ::placeholder {
  color: #484f58 !important;
  opacity: 1 !important;
}

/* ── Logout button ──────────────────────────────────────────────────────────── */
.stp-btn-logout {
  background: transparent !important;
  border: 1px solid rgba(248,81,73,.4) !important;
  color: #f85149 !important;
  width: auto !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
}
.stp-btn-logout:hover {
  background: rgba(248,81,73,.15) !important;
  border-color: #f85149 !important;
  color: #f85149 !important;
  opacity: 1 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Password strength bar ──────────────────────────────────────────────────── */
#stp-pwd-strength-bar {
  height: 5px;
  background: #21262d;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
#stp-pwd-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s, background .3s;
  width: 0;
}
#stp-pwd-strength-fill.stp-pwd-strength-0 { width: 0; }
#stp-pwd-strength-fill.stp-pwd-strength-1 { width: 20%; background: #f85149; }
#stp-pwd-strength-fill.stp-pwd-strength-2 { width: 40%; background: #d29922; }
#stp-pwd-strength-fill.stp-pwd-strength-3 { width: 60%; background: #e3b341; }
#stp-pwd-strength-fill.stp-pwd-strength-4 { width: 80%; background: #3fb950; }
#stp-pwd-strength-fill.stp-pwd-strength-5 { width: 100%; background: #56d364; }

/* ── Password requirements checklist ────────────────────────────────────────── */
.stp-pwd-requirements {
  list-style: none !important;
  padding: 8px 0 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px 12px !important;
}
.stp-pwd-requirements li {
  flex: none !important;
  font-size: 11.5px;
  color: #8b949e;
  padding: 0 !important;
  transition: color .2s;
}
.stp-pwd-requirements li::before {
  content: '✗ ';
  color: #f85149;
}
.stp-pwd-requirements li[data-ok="1"] {
  color: #56d364;
}
.stp-pwd-requirements li[data-ok="1"]::before {
  content: '✓ ';
  color: #56d364;
}

/* ── Field availability status indicators ────────────────────────────────────── */
.stp-field-with-status {
  position: relative;
}
.stp-field-status {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}
.stp-field-status[data-ok="1"] { color: #56d364; }
.stp-field-status[data-ok="0"] { color: #f85149; }

/* ── Danger button (Disabilita 2FA) ──────────────────────────────────────────── */
.stp-btn-danger {
  background: transparent !important;
  border: 1px solid rgba(248,81,73,.4) !important;
  color: #f85149 !important;
}
.stp-btn-danger:hover {
  background: rgba(248,81,73,.15) !important;
  border-color: #f85149 !important;
  color: #f85149 !important;
  opacity: 1 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── 2FA choice step ─────────────────────────────────────────────────────────── */
.stp-step-2fa-choice {
  text-align: center;
}
/* ── Activation banner ──────────────────────────────────────────────────────── */
.stp-activation-banner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(35,134,54,.15), rgba(63,185,80,.08));
  border: 1px solid rgba(63,185,80,.4); border-radius: 14px;
  padding: 22px 26px; margin-bottom: 20px; flex-wrap: wrap;
}
.stp-activation-check { font-size: 44px; line-height: 1; flex-shrink: 0; }
.stp-activation-text h2 {
  font-size: 20px; font-weight: 700; color: #56d364; margin: 0 0 6px;
}
.stp-activation-text p { color: var(--stp-muted); font-size: 14px; margin: 0; line-height: 1.6; }
.stp-activation-text strong { color: var(--stp-text); }

/* 2FA choice card */
.stp-2fa-choice-icon { text-align: center; font-size: 36px; margin-bottom: 10px; }
.stp-step-2fa-choice h3 { font-size: 17px; font-weight: 600; text-align: center; margin: 0 0 12px; }
.stp-2fa-choice-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.stp-step-2fa-choice p.stp-hint {
  margin-bottom: 24px;
}

/* ── Popup suggerimento 2FA ──────────────────────────────────────────────────── */
.stp-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.stp-popup-overlay.stp-popup-visible {
  opacity: 1;
  pointer-events: all;
}
.stp-popup {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  max-width: 440px;
  width: 100%;
  padding: 36px 40px;
  text-align: center;
  transform: translateY(20px);
  transition: transform .3s;
}
.stp-popup-overlay.stp-popup-visible .stp-popup {
  transform: translateY(0);
}
.stp-popup-icon {
  font-size: 52px;
  margin-bottom: 12px;
  line-height: 1;
}
.stp-popup h3 {
  font-size: 20px;
  font-weight: 700;
  color: #e6edf3;
  margin: 0 0 14px;
}
.stp-popup p {
  font-size: 14px;
  color: #8b949e;
  line-height: 1.6;
  margin: 0 0 10px;
}
.stp-popup p strong { color: #c9d1d9; }
.stp-popup-sub {
  font-size: 13px !important;
  color: #6e7681 !important;
  margin-bottom: 24px !important;
}
.stp-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── App compatibili 2FA ─────────────────────────────────────────────────── */
.stp-2fa-apps {
  margin: 14px 0 4px;
  border-top: 1px solid var(--stp-border);
  padding-top: 12px;
}
.stp-2fa-apps-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--stp-muted);
  font-weight: 600;
  margin: 0 0 8px;
}
.stp-2fa-app-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.stp-2fa-app-row:last-child { border-bottom: none; }
.stp-2fa-app-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 6px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.stp-2fa-app-icon svg { width: 16px !important; height: 16px !important; display: block; flex-shrink: 0; }
.stp-2fa-app-google { background: #fff; border: 2px solid #4285F4; }
.stp-2fa-app-apple  { background: #1c1c1e; color: #f5f5f7; border: 2px solid #888; }
.stp-2fa-app-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--stp-text);
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stp-2fa-app-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  background: rgba(56,139,253,.15);
  color: #79c0ff;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: .3px;
}
.stp-2fa-app-stores {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.stp-2fa-app-stores a {
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--stp-primary-h), var(--stp-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  padding: 0 6px;
  border-right: 1px solid rgba(255,255,255,.1);
  line-height: 1;
  transition: opacity .15s;
}
.stp-2fa-app-stores a:last-child { border-right: none; padding-right: 2px; }
.stp-2fa-app-stores a:hover { opacity: .75; }
.stp-2fa-info-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  padding: 3px 6px;
  color: var(--stp-muted);
  line-height: 1;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color .2s, background .2s, border-color .2s;
}
.stp-2fa-info-btn svg { width: 12px; height: 12px; }
.stp-2fa-info-btn:hover { color: var(--stp-primary); background: rgba(56,139,253,.12); border-color: rgba(56,139,253,.4); }

/* ── Popup guida app ─────────────────────────────────────────────────────── */
.stp-popup-guide {
  max-width: 820px;
  width: 100%;
  text-align: left;
  padding: 28px 32px 24px;
  position: relative;
}

/* Header: icona + titolo + X */
.stp-popup-guide .stp-guide-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stp-border);
}
.stp-popup-guide #stp-app-guide-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.stp-popup-guide #stp-app-guide-title {
  font-size: 18px !important;
  font-weight: 700;
  color: #f0f6fc !important;
  margin: 0 !important;
  flex: 1;
}
.stp-popup-close {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  color: var(--stp-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.stp-popup-close:hover { color: var(--stp-text); background: rgba(255,255,255,.06); }

/* Intro */
.stp-guide-intro {
  font-size: 14px;
  color: #c9d1d9;
  background: rgba(56,139,253,.08);
  border-left: 3px solid var(--stp-primary);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  line-height: 1.65;
  margin-bottom: 20px;
}

/* Tabella passi */
.stp-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #e6edf3;
}
.stp-guide-table thead tr {
  border-bottom: 2px solid rgba(56,139,253,.4);
}
.stp-guide-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8b949e;
}
.stp-guide-table thead th:first-child { width: 40px; text-align: center; }
.stp-guide-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .15s;
}
.stp-guide-table tbody tr:last-child { border-bottom: none; }
.stp-guide-table tbody tr:hover { background: rgba(56,139,253,.05); }

/* Colonna numero */
.stp-gt-num {
  text-align: center;
  padding: 14px 8px;
  vertical-align: middle;
  width: 40px;
}
.stp-gt-num span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--stp-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Colonna titolo */
.stp-gt-title {
  padding: 14px 16px 14px 12px;
  vertical-align: middle;
  font-weight: 600;
  font-size: 14px;
  color: #f0f6fc;
  white-space: nowrap;
  width: 28%;
}

/* Colonna descrizione */
.stp-gt-desc {
  padding: 14px 12px;
  vertical-align: middle;
  font-size: 14px;
  color: #c9d1d9;
  line-height: 1.6;
}
.stp-gt-desc strong { color: #e6edf3; }
.stp-gt-desc em { color: #a5d6ff; font-style: normal; font-weight: 600; }

/* Footer */
.stp-guide-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stp-border);
  display: flex;
  justify-content: flex-end;
}
#stp-app-guide-dismiss { border-color: #fff; color: #fff; }
#stp-app-guide-dismiss:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }

/* Responsive */
@media (max-width: 560px) {
  .stp-gt-title { white-space: normal; width: auto; }
  .stp-guide-table thead th:nth-child(2) { display: none; }
  .stp-gt-title { display: none; }
}
  .stp-popup-guide { padding: 18px 16px; }
}

/* ── Modale storico pagamenti ─────────────────────────────────────────────── */
.stp-modal-overlay {
  position: fixed !important; top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  animation: stp-fade-in .18s ease;
}
@keyframes stp-fade-in { from { opacity:0 } to { opacity:1 } }

.stp-modal {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 16px;
  width: 100%; max-width: 640px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  animation: stp-slide-up .2s ease;
}
@keyframes stp-slide-up { from { transform:translateY(20px); opacity:0 } to { transform:translateY(0); opacity:1 } }

.stp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #21262d;
}
.stp-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #f0f6fc; }

.stp-modal-close {
  background: none; border: none; color: #8b949e;
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.stp-modal-close:hover { color: #f0f6fc; background: rgba(255,255,255,.08); }

.stp-modal-body {
  overflow-y: auto; padding: 20px 24px 24px;
}

.stp-payments-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px; color: #c9d1d9;
}
.stp-payments-table thead th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: #8b949e;
  border-bottom: 1px solid #21262d;
}
.stp-payments-table tbody tr {
  border-bottom: 1px solid #161b22;
  transition: background .12s;
}
.stp-payments-table tbody tr:last-child { border-bottom: none; }
.stp-payments-table tbody tr:hover { background: rgba(56,139,253,.06); }
.stp-payments-table tbody td {
  padding: 12px 12px; vertical-align: middle;
}

/* ── Cambio piano ─────────────────────────────────────────────────────────── */
.stp-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .stp-plan-grid { grid-template-columns: 1fr; } }

.stp-plan-card {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s;
}
.stp-plan-card:hover { border-color: #58a6ff; }
.stp-plan-card--current {
  border-color: #3fb950;
  background: rgba(63,185,80,.06);
  cursor: default;
  pointer-events: none;
}
.stp-plan-badge {
  display: inline-block;
  background: #3fb950;
  color: #0d1117;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  margin-bottom: 6px;
  width: fit-content;
}
.stp-plan-name {
  font-size: 15px; font-weight: 700; color: #f0f6fc;
}
.stp-plan-billing {
  font-size: 12px; color: #8b949e;
}
.stp-plan-price {
  font-size: 22px; font-weight: 800; color: #58a6ff;
  margin: 6px 0 10px;
}
.stp-plan-price span {
  font-size: 13px; font-weight: 400; color: #8b949e;
}
.stp-plan-select-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

/* ── 2FA Scope options ──────────────────────────────────────────────────── */
.stp-2fa-scope-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stp-scope-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid #30363d;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.stp-scope-option:not(.stp-scope-option--disabled):hover {
  background: rgba(88,166,255,.07);
  border-color: rgba(88,166,255,.35);
}
.stp-scope-option--active {
  background: rgba(88,166,255,.10) !important;
  border-color: #388bfd !important;
}
.stp-scope-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.stp-scope-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}
.stp-scope-text strong {
  font-size: 14px;
  color: #f0f6fc;
}
.stp-scope-check {
  font-size: 16px;
  color: #388bfd;
  opacity: 0;
  transition: opacity .15s;
}
.stp-scope-option--active .stp-scope-check {
  opacity: 1;
}
.stp-2fa-scope-section {
  border-top: 1px solid #21262d;
  padding-top: 14px;
}
.stp-msg-ok  { color: #3fb950; }
.stp-msg-err { color: #f85149; }

/* ── Reset Password page ──────────────────────────────────────────────── */
.stp-subtitle {
  color: #8b949e;
  font-size: 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.stp-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.stp-pass-wrap input {
  flex: 1;
  padding-right: 42px;
}
.stp-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  color: #8b949e;
  transition: color .15s;
}
.stp-eye-btn:hover { color: #c9d1d9; }
.stp-pass-strength {
  font-size: 12px;
  margin-top: 5px;
  min-height: 16px;
  font-weight: 500;
  transition: color .2s;
}
