/* Two-Factor Authentication Styles */
.cm-2fa-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
}

.cm-2fa-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    color: #1d2327;
    font-size: 1.5em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.cm-2fa-section h2 .dashicons {
    color: #01824c;
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.cm-2fa-section > p.description {
    font-size: 14px;
    margin-bottom: 24px;
    color: #50575e;
    max-width: 800px;
}

.cm-2fa-methods {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.cm-2fa-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cm-2fa-card-header {
    background: #f9f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cm-2fa-icon {
    width: 24px;
    height: 24px;
    fill: #01824c;
}

.cm-2fa-card-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 1.1em;
}

.cm-2fa-card-content {
    padding: 20px;
}

.cm-2fa-description {
    margin-top: 0;
    margin-bottom: 16px;
    color: #50575e;
}

.cm-2fa-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cm-toggle-label {
    font-weight: 500;
}

/* Switch Styles */
.cm-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.cm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.cm-slider:before {
    position: absolute;
    content: '';
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .cm-slider {
    background-color: #01824c;
}

input:focus + .cm-slider {
    box-shadow: 0 0 1px #01824c;
}

input:checked + .cm-slider:before {
    transform: translateX(16px);
}

.cm-slider.round {
    border-radius: 34px;
}

.cm-slider.round:before {
    border-radius: 50%;
}

.cm-2fa-setup-section {
    background-color: #f9f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.cm-2fa-steps {
    margin: 0 0 20px 20px;
    padding: 0;
}

.cm-2fa-steps li {
    margin-bottom: 8px;
    color: #50575e;
}

.cm-2fa-secret-key {
    display: flex;
    align-items: center;
    background: #f0f0f1;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 16px;
}

.cm-2fa-secret-key code {
    flex: 1;
    background: none;
    padding: 0;
}

.cm-copy-secret {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px !important;
    height: auto !important;
    cursor: pointer;
    color: #01824c !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cm-copy-secret:hover {
    transform: scale(1.1);
    color: #015c36 !important;
}

.cm-copy-secret:focus {
    outline: none !important;
    box-shadow: none !important;
}

.cm-copy-secret .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.cm-2fa-verification {
    margin-top: 20px;
}

.cm-2fa-verification label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.cm-2fa-verification label .required {
    color: #d63638;
}

.cm-2fa-verification input {
    font-size: 16px;
    letter-spacing: 2px;
}

.cm-2fa-setup-columns {
    display: flex;
    gap: 24px;
}

.cm-2fa-setup-column {
    flex: 1;
}

.cm-2fa-setup-column h4 {
    margin: 0 0 1em 0;
}

.cm-2fa-qr-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cm-2fa-qrcode {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.cm-2fa-qrcode img {
    max-width: 280px;
    height: auto;
}
/* Ensure SVG/canvas output from QR libraries is visible and sized */
.cm-2fa-qrcode svg {
    max-width: 280px;
    height: auto;
    display: inline-block;
}
.cm-2fa-qrcode canvas {
    max-width: 280px;
    height: auto;
    display: inline-block;
}

.cm-2fa-manual-key h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.cm-2fa-manual-key p {
    margin-top: 0;
    margin-bottom: 6px;
}

.cm-2fa-email-info {
    margin-bottom: 20px;
}

.cm-2fa-email-info p {
    margin: 8px 0;
}

.cm-2fa-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fcf8e3;
    border: 1px solid #f0ad4e;
    padding: 12px;
    border-radius: 4px;
}

.cm-2fa-note-icon .dashicons {
    color: #f0ad4e;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.cm-2fa-note-content h4 {
    margin-top: 0;
    margin-bottom: 4px;
    color: #8a6d3b;
}

.cm-2fa-note-content p {
    margin: 0;
    color: #8a6d3b;
}

/* Success Status Styles */
.cm-2fa-status-success {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(1, 130, 76, 0.1);
    border: 1px solid #01824c;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    color: #01824c;
}

.cm-2fa-status-success .dashicons {
    color: #01824c;
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cm-2fa-status-success div {
    flex: 1;
}

.cm-2fa-status-success strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #01824c;
}

.cm-2fa-status-success p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Backup Codes Styles */
.cm-2fa-backup-codes-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.cm-2fa-backup-codes-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.cm-2fa-backup-codes-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 16px;
    color: #1d2327;
    font-size: 1.1em;
}

.cm-2fa-backup-codes-section h4 .dashicons {
    color: #01824c;
}

.cm-2fa-backup-codes-generated {
    background: #f9f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.cm-2fa-important-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fcf8e3;
    border: 1px solid #f0ad4e;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    color: #8a6d3b;
}

.cm-2fa-important-note .dashicons {
    color: #f0ad4e;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.cm-2fa-backup-codes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.cm-2fa-backup-codes-list code {
    display: block;
    background: #f0f0f1;
    border: 1px dashed #e0e0e0;
    padding: 8px;
    text-align: center;
    font-family: monospace;
    font-size: 14px;
    border-radius: 4px;
}

.cm-copy-backup-codes {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cm-copy-backup-codes .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 2FA Button Styles */
.cm-generate-backup-codes,
.cm-regenerate-backup-codes,
.cm-copy-backup-codes {
    background: #01824c !important;
    border-color: #01824c !important;
    color: #ffffff !important;
    transition: background-color 0.2s ease;
}

.cm-generate-backup-codes:hover,
.cm-regenerate-backup-codes:hover,
.cm-copy-backup-codes:hover {
    background: #016b3f !important;
    border-color: #016b3f !important;
    color: #ffffff !important;
}

.cm-2fa-backup-status {
    background: #f9f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.cm-2fa-status-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.cm-2fa-status-info .dashicons {
    color: #01824c;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.cm-backup-codes-notice {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.cm-backup-codes-notice .cm-backup-codes-list {
    grid-template-columns: repeat(5, 1fr);
}

/* Login form backup codes styles */
.login #cm_toggle_backup_code {
    color: #01824c;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.login #cm_toggle_backup_code:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2301824c"><path d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" /></svg>');
    background-size: contain;
}

.login #cm_toggle_backup_code:hover {
    color: #015c36;
    text-decoration: underline;
}

/* Login form buttons */
.login #wp-submit,
.login #wp-submit-backup,
.login #cm_2fa_resend {
    background: #01824c;
    border-color: #01824c;
    color: #ffffff;
    transition: background-color 0.2s ease;
}

.login #wp-submit:hover,
.login #wp-submit-backup:hover,
.login #cm_2fa_resend:hover {
    background: #016b3f;
    border-color: #016b3f;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .cm-2fa-setup-columns {
        flex-direction: column-reverse;
    }

    .cm-2fa-qr-column {
        margin-bottom: 20px;
    }
}
