/*
 * SEGURIDAD DEL PANEL AVANZADO
 * ============================================================
 *
 * La página usa tarjetas de ancho contenido. En escritorio se muestran
 * dos columnas; en móvil se apilan sin forzar anchuras.
 */

.cc-security-scope-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    max-width: 1180px;
    margin: 0 0 14px;
    padding: 11px 13px;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 10px;
    background: var(--cc-surface-2, #edf5fa);
}

.cc-security-scope-note strong {
    flex: 0 0 auto;
}

.cc-security-scope-note span {
    color: var(--cc-text-muted, #587184);
}

.cc-security-primary-grid,
.cc-security-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 580px));
    align-items: start;
    justify-content: start;
    gap: 14px;

    max-width: 1180px;
}

.cc-security-secondary-grid {
    margin-top: 14px;
}

.cc-security-primary-grid > .cc-admin-card,
.cc-security-secondary-grid > .cc-admin-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.cc-security-password-card .cc-admin-fields-grid.single-column {
    max-width: none;
}

.cc-security-placeholder-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    min-height: 118px;
}

.cc-security-placeholder-card h4,
.cc-totp-heading h4,
.cc-totp-intro h5,
.cc-totp-active-summary h5,
.cc-totp-manual h5,
.cc-totp-enrollment > h5,
.cc-totp-sensitive-form h5 {
    margin: 0;
}

.cc-security-coming-soon,
.cc-totp-badge {
    flex: 0 0 auto;
    padding: 5px 9px;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 999px;

    color: var(--cc-text-muted, #587184);
    background: var(--cc-surface-2, #edf5fa);

    font-size: 11px;
    font-weight: 800;
}

.cc-totp-card {
    min-height: 100%;
}

.cc-totp-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cc-totp-heading p,
.cc-totp-intro p,
.cc-totp-active-summary p,
.cc-totp-manual p,
.cc-totp-sensitive-form p,
.cc-totp-policy-note,
.cc-totp-warning {
    margin: 6px 0 0;
}

.cc-totp-badge.success {
    color: var(--cc-success, #267a5a);
    border-color: var(--cc-success, #2d936c);
}

.cc-totp-badge.warning {
    color: var(--cc-warning-text, #805e00);
    border-color: var(--cc-warning, #d7a514);
}

.cc-totp-badge.danger {
    color: var(--cc-danger, #b83f4a);
    border-color: var(--cc-danger, #c84b55);
}

.cc-totp-body {
    margin-top: 16px;
}

.cc-totp-loading,
.cc-totp-error-box,
.cc-totp-pending-note,
.cc-totp-action-panel {
    padding: 11px 12px;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 10px;

    color: var(--cc-text-muted, #587184);
    background: var(--cc-surface-2, #edf5fa);
}

.cc-totp-error-box {
    color: var(--cc-danger, #b83f4a);
    border-color: var(--cc-danger, #c84b55);
}

.cc-totp-pending-note {
    margin-top: 12px;
}

.cc-totp-start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;

    margin-top: 14px;
}

.cc-totp-start-grid .button {
    min-height: 40px;
}

.cc-totp-enrollment {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--cc-border, #c8d9e4);
}

.cc-totp-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;

    margin: 12px 0 14px;
}

.cc-totp-step {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px;

    border-radius: 9px;
    background: var(--cc-surface-2, #edf5fa);
}

.cc-totp-step > span {
    display: grid;
    place-items: center;

    width: 23px;
    height: 23px;

    color: var(--cc-accent-text, #ffffff);
    background: var(--cc-accent, #258bc4);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 900;
}

.cc-totp-step strong {
    font-size: 11px;
}

.cc-totp-qr-layout {
    display: grid;
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.cc-totp-qr-box {
    display: grid;
    place-items: center;

    min-height: 190px;
    padding: 10px;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 12px;
    background: #ffffff;
}

.cc-totp-qr-box img {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
}

.cc-totp-secret-row {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 10px;
}

.cc-totp-secret-row code {
    min-width: 0;
    flex: 1;

    padding: 9px 10px;
    overflow-wrap: anywhere;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 8px;
    background: var(--cc-surface-1, #ffffff);

    font-size: 12px;
}

.cc-totp-confirm-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto;
    align-items: end;
    gap: 10px;

    margin-top: 16px;
}

.cc-totp-code {
    letter-spacing: 0.28em;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.cc-totp-warning,
.cc-totp-policy-note {
    color: var(--cc-text-muted, #587184);
    font-size: 11px;
}

.cc-totp-notice {
    min-height: 18px;
    margin: 12px 0 0;

    color: var(--cc-text-muted, #587184);
    font-size: 12px;
}

.cc-totp-notice.success {
    color: var(--cc-success, #267a5a);
}

.cc-totp-notice.error {
    color: var(--cc-danger, #b83f4a);
}

.cc-totp-active-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 12px;

    border: 1px solid var(--cc-success, #2d936c);
    border-radius: 11px;
}

.cc-totp-success-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    color: #ffffff;
    background: var(--cc-success, #2d936c);
    border-radius: 999px;

    font-weight: 900;
}

.cc-totp-factor-list {
    display: grid;
    gap: 8px;

    margin-top: 12px;
}

.cc-totp-factor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 10px 12px;

    border: 1px solid var(--cc-border, #c8d9e4);
    border-radius: 9px;
    background: var(--cc-surface-2, #edf5fa);
}

.cc-totp-factor-row > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cc-totp-factor-row > div:last-child {
    align-items: flex-end;
    text-align: right;
}

.cc-totp-factor-row span {
    color: var(--cc-text-muted, #587184);
    font-size: 10px;
}

.cc-totp-actions,
.cc-totp-sensitive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 12px;
}

.cc-totp-action-panel {
    margin-top: 12px;
}

.cc-totp-action-panel.hidden {
    display: none;
}

.cc-totp-sensitive-form {
    display: grid;
    gap: 11px;
}

.cc-totp-sensitive-form.danger-zone {
    border-left: 3px solid var(--cc-danger, #c84b55);
    padding-left: 12px;
}

.cc-totp-sensitive-form small {
    color: var(--cc-text-muted, #587184);
}

.cc-totp-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    color: var(--cc-text-muted, #587184);
    font-size: 12px;
}

.cc-totp-confirm-check input {
    margin-top: 2px;
}

@media screen and (max-width: 1100px) {
    .cc-security-primary-grid,
    .cc-security-secondary-grid {
        grid-template-columns: minmax(0, 680px);
    }
}

@media screen and (max-width: 760px) {
    .cc-security-scope-note,
    .cc-security-placeholder-card,
    .cc-totp-heading,
    .cc-totp-factor-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .cc-security-primary-grid,
    .cc-security-secondary-grid,
    .cc-totp-start-grid,
    .cc-totp-confirm-form,
    .cc-totp-qr-layout,
    .cc-totp-steps {
        grid-template-columns: 1fr;
    }

    .cc-totp-factor-row > div:last-child {
        align-items: flex-start;
        text-align: left;
    }

    .cc-totp-secret-row {
        align-items: stretch;
        flex-direction: column;
    }
}
