/**
 * VMPFence Login Security - 2FA Styles
 * Design System: Midnight Blue (#191970)
 * Font: Inter
 * 
 * @package VMPFence
 * @since 2.1.0
 */

/* ==========================================================================
   Typography
   ========================================================================== */

.vmpfence-login-security,
.vmpfence-login-security * {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
}

.vmpfence-login-security {
    max-width: 1300px;
}

/* Exception for dashicons - must use dashicons font */
.vmpfence-login-security .dashicons,
.vmpfence-login-security .dashicons-before:before {
    font-family: 'dashicons' !important;
}

/* ==========================================================================
   Card Layout
   ========================================================================== */

.vmpfence-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(25, 25, 112, 0.08);
}

.vmpfence-card-header {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vmpfence-card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #191970;
}

.vmpfence-card-body {
    padding: 12px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.vmpfence-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.vmpfence-badge-premium {
    background: #191970;
    color: #fff;
}

.vmpfence-badge-upgrade {
    background: #f5f5f5;
    color: #191970;
}

.vmpfence-optional-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #666;
    margin-left: 8px;
}

/* ==========================================================================
   Notices
   ========================================================================== */

.vmpfence-notice {
    padding: 16px 20px;
    border-left: 4px solid #007AFF;
    background: #f0f6fc;
    margin: 16px 0;
    border-radius: 12px;
}

.vmpfence-notice h3 {
    margin-top: 0;
    font-weight: 600;
}

.vmpfence-notice-info {
    border-left-color: #007AFF;
    background: #e6f2ff;
}

.vmpfence-notice-warning {
    border-left-color: #F5A623;
    background: #fff8e6;
}

.vmpfence-notice-success {
    border-left-color: #00a32a;
    background: #edfaef;
}

/* ==========================================================================
   2FA Status Display
   ========================================================================== */

.vmpfence-2fa-status {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.vmpfence-2fa-enabled {
    background: #edfaef;
    border: 2px solid #00a32a;
}

.vmpfence-2fa-disabled {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
}

.vmpfence-status-icon {
    font-size: 36px;
    margin-right: 12px;
}

.vmpfence-2fa-enabled .vmpfence-status-icon {
    color: #00a32a;
}

.vmpfence-2fa-disabled .vmpfence-status-icon {
    color: #191970;
    opacity: 0.6;
}

.vmpfence-status-content h3 {
    margin-top: 0;
    margin-bottom: 4px;
    font-weight: 600;
    color: #191970;
}

.vmpfence-status-content p {
    margin: 0;
    color: #666;
}

/* ==========================================================================
   2FA Actions & Buttons
   ========================================================================== */

.vmpfence-2fa-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.vmpfence-2fa-setup {
    margin: 24px 0;
}

/* Button Overrides for Midnight Blue Theme */
.vmpfence-login-security .button-primary {
    background: #191970;
    border-color: #191970;
    color: #fff;
    border-radius: 12px;
    padding: 8px 20px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(25, 25, 112, 0.15);
    transition: all 0.2s ease;
}

.vmpfence-login-security .button-primary:hover,
.vmpfence-login-security .button-primary:focus {
    background: #0f0f50;
    border-color: #0f0f50;
    color: #fff;
    box-shadow: 0 4px 8px rgba(25, 25, 112, 0.25);
}

.vmpfence-login-security .button-secondary {
    background: #fff;
    border-color: #191970;
    color: #191970;
    border-radius: 12px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.vmpfence-login-security .button-secondary:hover,
.vmpfence-login-security .button-secondary:focus {
    background: #f8f8f8;
    border-color: #0f0f50;
    color: #0f0f50;
}

.vmpfence-login-security .button {
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* ==========================================================================
   Single Page Setup - Two Column Grid
   ========================================================================== */

.vmpfence-2fa-setup-container {
    border-top: 2px solid #e0e0e0;
    margin-top: 12px;
    padding-top: 12px;
}

.vmpfence-2fa-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.vmpfence-qr-section h3,
.vmpfence-codes-section h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #191970;
}

.vmpfence-description {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
    .vmpfence-2fa-setup-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ==========================================================================
   QR Code Display
   ========================================================================== */

.vmpfence-qr-container {
    text-align: center;
    padding: 12px;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin: 10px 0;
}

.vmpfence-qr-container img {
    max-width: 260px;
    height: auto;
    border: 2px solid #191970;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
}

.vmpfence-manual-entry {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.vmpfence-manual-label {
    color: #191970;
    font-weight: 600;
    margin-bottom: 8px;
}

.vmpfence-secret-key {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.vmpfence-secret-key code {
    flex: 1;
    background: #f8f8f8;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    color: #191970;
    word-break: break-all;
}

.vmpfence-copy-btn {
    flex-shrink: 0;
    border-radius: 8px !important;
}

/* ==========================================================================
   Code Input & Verification Section
   ========================================================================== */

.vmpfence-verification-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e0e0e0;
}

.vmpfence-verify-description {
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.vmpfence-code-input-group {
    margin: 20px 0;
}

.vmpfence-code-input {
    width: 100% !important;
    max-width: 200px !important;
    height: 56px !important;
    font-size: 24px !important;
    text-align: center !important;
    letter-spacing: 8px !important;
    font-family: 'Courier New', monospace !important;
    border: 2px solid #191970 !important;
    border-radius: 12px !important;
    color: #191970 !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
}

.vmpfence-code-input:focus {
    border-color: #007AFF !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
    outline: none !important;
}

.vmpfence-help-link {
    color: #666;
    font-size: 13px;
    margin: 16px 0;
}

.vmpfence-help-link a {
    color: #007AFF;
    text-decoration: none;
    font-weight: 600;
}

.vmpfence-help-link a:hover {
    text-decoration: underline;
}

.vmpfence-activate-btn {
    width: 100%;
    max-width: 200px;
    height: 48px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 8px;
}

.vmpfence-cancel-action {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* ==========================================================================
   Backup Codes Display (Right Column)
   ========================================================================== */

.vmpfence-backup-codes-display {
    background: #f8f8f8;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
}

.vmpfence-backup-codes-display h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #191970;
}

.vmpfence-codes-description {
    margin-bottom: 16px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.vmpfence-codes-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.vmpfence-code-item {
    background: #fff;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: left;
}

.vmpfence-code-item code {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    color: #191970;
}

.vmpfence-download-btn {
    width: 100%;
    border-radius: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    background: #007AFF !important;
    border-color: #007AFF !important;
    color: #fff !important;
}

.vmpfence-download-btn:hover {
    background: #0056d6 !important;
    border-color: #0056d6 !important;
}

.vmpfence-codes-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* Backup codes container (for enabled state) */
.vmpfence-backup-codes {
    background: #f8f8f8;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
    border: 1px solid #e0e0e0;
}

.vmpfence-backup-codes h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #191970;
    font-weight: 600;
}

.vmpfence-backup-codes .description {
    margin-bottom: 20px;
    color: #666;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

.vmpfence-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(25, 25, 112, 0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.vmpfence-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 50px;
    height: 50px;
    animation: vmpfence-spin 1s linear infinite;
}

@keyframes vmpfence-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vmpfence-overlay p {
    color: #fff;
    font-size: 16px;
    margin-top: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Button Enhancements
   ========================================================================== */

.button .dashicons {
    margin-right: 6px;
    vertical-align: middle;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
    .vmpfence-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vmpfence-badge {
        margin-top: 12px;
    }
    
    .vmpfence-2fa-status {
        flex-direction: column;
    }
    
    .vmpfence-status-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .vmpfence-2fa-actions {
        flex-direction: column;
    }
    
    .vmpfence-2fa-actions .button {
        width: 100%;
    }
    
    .vmpfence-codes-grid {
        grid-template-columns: 1fr;
    }
    
    .vmpfence-code-input {
        max-width: 100% !important;
    }
    
    .vmpfence-activate-btn {
        max-width: 100% !important;
    }
    
    .vmpfence-qr-container img {
        max-width: 100%;
    }
}

/* ==========================================================================
   Login Page 2FA Prompt Styles
   ========================================================================== */

#vmpfence-2fa-prompt {
    margin-top: 20px;
    padding: 20px;
    background: #f0f6fc;
    border: 1px solid #72aee6;
    border-radius: 4px;
}

#vmpfence-2fa-prompt h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #135e96;
}

#vmpfence-2fa-prompt .vmpfence-2fa-code-input {
    width: 100% !important;
    max-width: 200px;
    height: 50px !important;
    font-size: 20px !important;
    text-align: center !important;
    letter-spacing: 6px !important;
    margin: 12px 0 !important;
}

#vmpfence-2fa-prompt .vmpfence-backup-link {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
}

#vmpfence-2fa-backup-form {
    margin-top: 16px;
}

#vmpfence-2fa-backup-form input[type="text"] {
    width: 100%;
    max-width: 250px;
}

.vmpfence-2fa-error {
    color: #d63638;
    margin-top: 12px;
}

.vmpfence-2fa-success {
    color: #00a32a;
    margin-top: 12px;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */

.vmpfence-tabs {
    margin: 24px 0 24px 0;
    overflow: visible;
}

.vmpfence-tabs-nav {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #dcdcdc;
    background: transparent;
    padding: 0;
    margin: 0;
    list-style: none;
    gap: 0;
}

.vmpfence-tabs-nav li {
    margin: 0;
    padding: 0;
}

.vmpfence-tabs-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    background: #f5f5f5;
    color: #2c3338;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-top: 3px solid transparent;
    border-right: 1px solid #dcdcdc;
    height: 100%;
    white-space: nowrap;
}

.vmpfence-tabs-nav li:first-child button {
    border-left: 1px solid #dcdcdc;
}

.vmpfence-tabs-nav button:hover {
    background: #ffffff;
    color: #191970;
}

.vmpfence-tabs-nav button.active {
    background: #ffffff;
    color: #191970;
    font-weight: 700;
    border-top: 3px solid #007AFF;
    border-bottom: 1px solid #ffffff;
    margin-bottom: -1px;
}

/* Tab Content */
.vmpfence-tab-content {
    display: none;
    padding: 0;
}

.vmpfence-tab-content.active {
    display: block;
}

/* Settings Tab Specific Layout */
#settings.vmpfence-tab-content {
    max-width: 1300px;
}

/* ==========================================================================
   Login Settings Styles
   ========================================================================== */

/* Coming Soon Notice */
.login-settings-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.login-settings-notice-info {
    background: #F5F7FA;
    border-left: 4px solid #191970;
    color: #191970;
}

.login-settings-notice .dashicons {
    color: #191970;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
}

/* Settings Header */
.login-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.login-settings-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #191970;
}

.login-settings-actions {
    display: flex;
    gap: 12px;
}

.login-settings-actions .button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 12px;
    padding: 8px 20px;
    height: 40px;
}

.login-settings-actions .button-primary {
    background: #191970;
    border-color: #191970;
}

.login-settings-actions .button-primary:hover {
    background: #007AFF;
    border-color: #007AFF;
}

/* Settings Sections */
.login-settings-section {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 100%;
}

.login-settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #191970;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* User Summary Table */
.login-settings-user-summary {
    max-width: 100%;
    overflow-x: auto;
}

.login-settings-user-summary table {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.login-settings-user-summary table thead th {
    background: #191970;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 12px;
}

.login-settings-user-summary table tbody td {
    padding: 12px;
    font-family: 'Inter', sans-serif;
}

.login-settings-manage-link {
    margin: 16px 0 0 0;
}

.login-settings-manage-link a {
    color: #007AFF;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.login-settings-manage-link a:hover {
    color: #191970;
    text-decoration: underline;
}

/* Option Rows */
.login-settings-option-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.login-settings-option-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.login-settings-option-label {
    flex: 0 0 300px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #191970;
    padding-top: 8px;
    cursor: pointer;
}

.login-settings-option-label input[type="checkbox"] {
    cursor: pointer;
}

.login-settings-option-control {
    flex: 1;
}

.login-settings-option-control .description {
    margin-top: 8px;
    font-size: 13px;
    color: #646970;
    font-family: 'Inter', sans-serif;
}

/* IP Allowlist Status Messages */
.success-text {
    color: #00a32a;
    font-size: 13px;
}

.error-text {
    color: #d63638;
    font-size: 13px;
}

/* Role Group */
.login-settings-role-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.login-settings-role-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #191970;
    font-size: 13px;
}

.login-settings-role-item select {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
}

/* Button Group */
.login-settings-button-group {
    display: inline-flex;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
}

.login-settings-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: #f5f5f5;
    color: #2c3338;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: not-allowed;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.login-settings-toggle-btn:last-child {
    border-right: none;
}

/* Form Inputs */
.login-settings-section input[type="text"],
.login-settings-section input[type="number"],
.login-settings-section textarea,
.login-settings-section select {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.login-settings-section input[type="text"]:focus,
.login-settings-section input[type="number"]:focus,
.login-settings-section textarea:focus,
.login-settings-section select:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

.login-settings-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* Phase 1 checkboxes - enabled and clickable */
#show_last_login_column,
#delete_on_deactivate {
    cursor: pointer;
}

/* Future phase checkboxes - disabled */
.login-settings-section input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.login-settings-section .button {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 12px;
}

.login-settings-section .small-text {
    height: 40px;
}

.login-settings-section .regular-text,
.login-settings-section .large-text {
    padding: 12px 16px;
}
/* ==========================================================================
   Last Login Column (Users Page)
   ========================================================================== */

.vmpfence-never-logged-in {
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   Phase 4: Toggle Buttons (XML-RPC 2FA)
   ========================================================================== */

.login-settings-button-group {
    display: inline-flex;
    gap: 0;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 2px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.login-settings-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    min-width: 85px;
    text-align: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-settings-toggle-btn:hover:not(.active) {
    background: #e9e9e9;
    color: #333;
}

.login-settings-toggle-btn.active {
    background: #007AFF;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

.login-settings-toggle-btn.active:hover {
    background: #0066CC;
}