/* Step-up re-authentication dialog (assets/js/step-up.js).
 * Everything is scoped under .su-dialog and resets the bits global/CDN styles like to set on
 * buttons, inputs and headings, so nothing overlaps. */

.su-dialog {
    width: min(480px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: auto;
    background: var(--surface, #fff);
    color: var(--text, #111827);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.su-dialog::backdrop { background: rgba(17, 24, 39, 0.55); backdrop-filter: blur(2px); }

.su-dialog *,
.su-dialog *::before,
.su-dialog *::after { box-sizing: border-box; }

.su-dialog h2,
.su-dialog p,
.su-dialog label { margin: 0; padding: 0; float: none; }

.su-dialog button,
.su-dialog input {
    margin: 0;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    min-height: 0;
    height: auto;
    float: none;
}

/* Header */
.su-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 24px 0;
}
.su-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: var(--accent-soft, #e0e7ff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 4v5c0 4.5-3 8-7 9-4-1-7-4.5-7-9V7l7-4z'/%3E%3Cpath d='M9.5 12l2 2 3-3.5'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.su-head-text { flex: 1 1 auto; min-width: 0; }
.su-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.su-intro { margin-top: 4px; font-size: 0.85rem; color: var(--text-muted, #6b7280); }

/* The change being confirmed */
.su-action {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 16px 24px 0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--bg, #f6f7f9);
}
.su-action-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #6b7280); }
.su-action-name { font-size: 0.9rem; font-weight: 600; color: var(--text, #111827); overflow-wrap: anywhere; }

/* Body */
.su-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 24px 4px; }

.su-methods {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--bg, #f6f7f9);
}
.su-tab {
    min-width: 0;
    padding: 8px 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.su-tab:hover { color: var(--text, #111827); }
.su-tab.is-active { background: var(--surface, #fff); color: var(--text, #111827); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.su-tab:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 1px; }

.su-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.su-hint { font-size: 0.84rem; color: var(--text-muted, #6b7280); }
.su-label { margin-top: 4px; font-size: 0.78rem; font-weight: 600; color: var(--text, #111827); }

.su-code {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--text, #111827);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-indent: 0.4em; /* balances the trailing letter-spacing so digits sit centred */
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.su-code::placeholder { color: var(--border, #d1d5db); }
.su-code:focus { outline: none; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 3px var(--accent-soft, #e0e7ff); }
.su-code:disabled { background: var(--bg, #f6f7f9); }

.su-status { min-height: 1.3em; font-size: 0.82rem; color: var(--text-muted, #6b7280); }
.su-status:empty { min-height: 0; }
.su-status--error { color: var(--danger, #dc2626); }
.su-status--ok { color: var(--success, #059669); }

/* Footer */
.su-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding: 14px 24px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--bg, #f6f7f9);
}

/* Buttons */
.su-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 9px;
    background: var(--surface, #fff);
    color: var(--text, #111827);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}
.su-btn:hover:not(:disabled) { background: var(--bg, #f6f7f9); }
.su-btn:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.su-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.su-btn[hidden] { display: none; }
.su-btn--primary { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
.su-btn--primary:hover:not(:disabled) { background: var(--accent, #2563eb); filter: brightness(1.08); }
.su-btn--wide { width: 100%; padding: 12px 16px; }
.su-key {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M10.8 12.2 20 3M17 6l3 3M14 9l2 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 480px) {
    .su-head { padding: 18px 16px 0; }
    .su-action { margin: 14px 16px 0; }
    .su-body { padding: 16px 16px 4px; }
    .su-foot { padding: 12px 16px; }
    .su-foot .su-btn { flex: 1; }
}
