/**
 * Authyo Passwordless Login — Google Authenticator setup panel (admin)
 * Uses the WordPress admin palette so it sits naturally inside the settings cards.
 */

.authyo-ga {
    max-width: 720px;
}

/* The panel toggles visibility with the `hidden` attribute. Several elements below set
   their own display (flex/block), which would otherwise override it. */
.authyo-ga [hidden] {
    display: none !important;
}

/* ── Header: icon, title, status badge ─────────────────────────────────── */

.authyo-ga-head {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f0f1;
}

.authyo-ga-head-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 10px;
    background: #f0f6fc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.authyo-ga-head-icon .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.authyo-ga-head-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.authyo-ga-head-meta {
    margin-top: 3px;
    color: #646970;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.authyo-ga-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    background: #f0f0f1;
    color: #50575e;
}

.authyo-ga-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.authyo-ga-badge[data-badge="active"]   { background: #edfaef; color: #008a20; }
.authyo-ga-badge[data-badge="inactive"] { background: #fcf9e8; color: #996800; }
.authyo-ga-badge[data-badge="error"]    { background: #fcf0f1; color: #d63638; }

/* ── Inline notices ─────────────────────────────────────────────────────── */

.authyo-ga-notice {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-left: 4px solid #72aee6;
    background: #f0f6fc;
    color: #1d2327;
    border-radius: 2px;
}

.authyo-ga-notice.is-success { border-left-color: #00a32a; background: #edfaef; }
.authyo-ga-notice.is-error   { border-left-color: #d63638; background: #fcf0f1; }

/* ── Sections ───────────────────────────────────────────────────────────── */

.authyo-ga-section > p:first-child { margin-top: 0; }

.authyo-ga-apps { color: #646970; }

.authyo-ga-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #646970;
}

.authyo-ga .spinner {
    float: none;
    margin: 0;
}

.authyo-ga-error-text { color: #d63638; }

/* Numbered setup steps */
.authyo-ga-steps {
    list-style: none;
    counter-reset: authyo-ga-step;
    margin: 0;
    padding: 0;
}

.authyo-ga-steps > li {
    counter-increment: authyo-ga-step;
    position: relative;
    padding: 0 0 20px 40px;
    margin: 0;
}

.authyo-ga-steps > li::before {
    content: counter(authyo-ga-step);
    position: absolute;
    left: 0;
    top: -1px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.authyo-ga-steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 30px;
    bottom: 4px;
    width: 2px;
    background: #dcdcde;
}

.authyo-ga-steps strong {
    display: block;
    color: #1d2327;
    margin-bottom: 2px;
}

.authyo-ga-steps span {
    color: #646970;
}

/* QR code */
.authyo-ga-qr {
    margin-top: 12px;
    width: 196px;
    min-height: 196px;
    padding: 10px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.authyo-ga-qr img {
    width: 176px;
    height: 176px;
    display: block;
    image-rendering: pixelated;
}

.authyo-ga-qr-loading {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #646970;
    font-size: 12px;
    text-align: center;
}

/* Code entry */
.authyo-ga-code-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.authyo-ga .authyo-ga-code {
    width: 150px;
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: 6px;
    text-align: center;
    font-family: Menlo, Consolas, monospace;
    padding: 6px 8px;
}

.authyo-ga-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.authyo-ga .button.authyo-ga-danger {
    color: #b32d2e;
    border-color: #b32d2e;
}

.authyo-ga .button.authyo-ga-danger:hover,
.authyo-ga .button.authyo-ga-danger:focus {
    color: #fff;
    background: #b32d2e;
    border-color: #b32d2e;
}

.authyo-ga .button[aria-busy="true"] {
    cursor: progress;
}

/* ── Login-page fallback switch ─────────────────────────────────────────── */

.authyo-ga-fallback {
    margin-top: 24px;
    padding: 14px 16px;
    background: #f6f7f7;
    border: 1px solid #f0f0f1;
    border-radius: 8px;
}

.authyo-ga-fallback .description {
    margin: 6px 0 0 50px;
}

.authyo-ga-fallback-hint {
    color: #996800 !important;
}

.authyo-ga-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #1d2327;
}

.authyo-ga-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.authyo-ga-switch-track {
    flex: 0 0 38px;
    height: 22px;
    border-radius: 999px;
    background: #8c8f94;
    position: relative;
    transition: background .15s ease;
}

.authyo-ga-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

.authyo-ga-switch input:checked + .authyo-ga-switch-track { background: #2271b1; }
.authyo-ga-switch input:checked + .authyo-ga-switch-track::after { transform: translateX(16px); }
.authyo-ga-switch input:focus-visible + .authyo-ga-switch-track { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1; }
.authyo-ga-switch input:disabled + .authyo-ga-switch-track { opacity: .5; }
.authyo-ga-switch:has(input:disabled) { cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
    .authyo-ga-switch-track,
    .authyo-ga-switch-track::after { transition: none; }
}

/* ── Administrators table ───────────────────────────────────────────────── */

.authyo-ga-team {
    margin-top: 28px;
}

.authyo-ga-team-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.authyo-ga-team-head h3 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #1d2327;
}

.authyo-ga-team-head .description {
    margin: 0;
    max-width: 480px;
}

.authyo-ga-team-head .button {
    flex-shrink: 0;
}

.authyo-ga-team-table td {
    vertical-align: middle;
}

.authyo-ga-team-email {
    color: #646970;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.authyo-ga-you {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 3px;
    background: #f0f6fc;
    color: #2271b1;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    vertical-align: 1px;
}

.authyo-ga-team-date,
.authyo-ga-team-actions.is-muted {
    color: #646970;
}

.authyo-ga-team-actions {
    text-align: right;
    white-space: nowrap;
}

.authyo-ga .button-link.authyo-ga-link-danger {
    color: #b32d2e;
    text-decoration: none;
}

.authyo-ga .button-link.authyo-ga-link-danger:hover,
.authyo-ga .button-link.authyo-ga-link-danger:focus {
    color: #8a2424;
    text-decoration: underline;
}

.authyo-ga-team-empty {
    color: #646970;
}

.authyo-ga-team-empty .spinner {
    vertical-align: middle;
}

/* ── Empty state (no App ID) ────────────────────────────────────────────── */

.authyo-ga-empty {
    text-align: center;
    padding: 24px 12px;
}

.authyo-ga-empty .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #8c8f94;
}

.authyo-ga-empty p { margin: 6px 0; }
.authyo-ga-empty .button { margin-top: 8px; }

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .authyo-ga-steps > li { padding-left: 34px; }
    .authyo-ga-fallback .description { margin-left: 0; }
    .authyo-ga .authyo-ga-code { width: 100%; }
    .authyo-ga-code-row .button-primary { flex: 1; }
    .authyo-ga-team-head { flex-direction: column; }
    .authyo-ga-team-table thead { display: none; }
    .authyo-ga-team-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; }
    .authyo-ga-team-table td { padding: 0 10px; }
    .authyo-ga-team-actions { text-align: left; }
}
