/* RAT Two-Factor Authentication Pro - TOTP Styles */

/* ===== TOTP LOGIN FORM ===== */
.rat-2fa-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rat-2fa-form h2 {
    text-align: center;
    margin: 0 0 20px 0;
    color: #23282d;
    font-size: 24px;
    font-weight: 600;
}

.rat-2fa-form .form-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.rat-2fa-form .user-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.rat-2fa-form .user-info strong {
    color: #495057;
}

/* ===== METHOD SELECTION ===== */
.method-selection {
    margin-bottom: 25px;
}

.method-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.method-tab {
    flex: 1;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    color: #495057;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.method-tab:first-child {
    border-radius: 6px 0 0 0;
}

.method-tab:last-child {
    border-radius: 0 6px 0 0;
}

.method-tab:hover {
    background: #e9ecef;
}

.method-tab.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    color: #0073aa;
    margin-bottom: -2px;
}

/* ===== TOTP INPUT ===== */
.totp-input-section {
    margin-bottom: 20px;
}

.totp-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #23282d;
}

.totp-code-input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: 8px;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

.totp-code-input:focus {
    outline: none;
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.totp-code-input::placeholder {
    color: #ccc;
}

/* ===== BACKUP CODE SECTION ===== */
.backup-code-section {
    display: none;
}

.backup-code-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

.backup-code-input:focus {
    outline: none;
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    text-align: center;
    margin-top: 25px;
}

.form-actions .button {
    min-width: 120px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-actions .button-primary {
    background: linear-gradient(135deg, #0073aa, #005177);
    border: none;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,115,170,0.3);
}

.form-actions .button-primary:hover {
    background: linear-gradient(135deg, #005177, #003850);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,115,170,0.4);
}

.form-actions .button-primary:disabled {
    background: #ccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* ===== ALTERNATIVE OPTIONS ===== */
.alternative-options {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.alternative-options a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.alternative-options a:hover {
    color: #005177;
    text-decoration: underline;
}

.alternative-options .separator {
    margin: 0 10px;
    color: #ccc;
}

/* ===== TOTP SETUP MODAL ===== */
.rat-2fa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rat-2fa-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rat-2fa-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.rat-2fa-modal-header h3 {
    margin: 0;
    color: #23282d;
    font-size: 20px;
    font-weight: 600;
}

.rat-2fa-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.rat-2fa-modal-close:hover {
    background: #dc3545;
    color: #fff;
}

.rat-2fa-modal-body {
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.modal-padding {
    padding: 30px;
}

/* ===== TOTP SETUP STEPS ===== */
.totp-setup-steps {
    max-width: 100%;
}

.setup-step {
    margin-bottom: 30px;
    padding: 25px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafafa;
}

.setup-step:last-child {
    margin-bottom: 0;
}

.setup-step h4 {
    margin: 0 0 15px 0;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.setup-step h4::before {
    content: '';
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073aa, #005177);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
}

.setup-step:nth-child(1) h4::before {
    content: '1';
}

.setup-step:nth-child(2) h4::before {
    content: '2';
}

.setup-step:nth-child(3) h4::before {
    content: '3';
}

.setup-step p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== QR CODE ===== */
.qr-code-container {
    text-align: center;
    padding: 25px;
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.qr-code-container img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    padding: 10px;
}

.secret-key-manual {
    margin-top: 20px;
    text-align: center;
}

.secret-key {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 15px;
    font-family: monospace;
    font-size: 14px;
    letter-spacing: 2px;
    word-break: break-all;
    margin: 10px 0;
    color: #5f6368;
    user-select: all;
}

/* ===== VERIFICATION INPUT ===== */
.verification-input {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.verification-input input {
    width: 150px;
    padding: 12px 15px;
    font-size: 20px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: 3px;
    transition: border-color 0.3s ease;
}

.verification-input input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.verification-input .button {
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 6px;
}

/* ===== BACKUP CODES DISPLAY ===== */
.backup-codes-display {
    text-align: center;
}

.backup-codes-display h4 {
    color: #23282d;
    margin-bottom: 15px;
    font-size: 18px;
}

.backup-codes-display p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 25px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.backup-code {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 8px;
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #495057;
    user-select: all;
    transition: all 0.3s ease;
    cursor: pointer;
}

.backup-code:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: scale(1.05);
}

.backup-codes-actions {
    margin: 25px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.backup-codes-actions .button {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 6px;
}

.backup-codes-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 25px;
}

.backup-codes-warning p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

/* ===== PROFILE SETTINGS ===== */
.totp-profile-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.totp-profile-section h3 {
    margin-top: 0;
    color: #23282d;
    display: flex;
    align-items: center;
}

.totp-profile-section h3::before {
    content: '🔐';
    font-size: 24px;
    margin-right: 10px;
}

.totp-status {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
}

.totp-status.enabled {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.totp-status.disabled {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.totp-status-icon {
    font-size: 20px;
    margin-right: 10px;
}

.totp-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.totp-actions .button {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 6px;
}

/* ===== LOADING OVERLAY ===== */
.totp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totp-loading-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MESSAGES ===== */
.totp-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.totp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.totp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .rat-2fa-form {
        margin: 20px;
        padding: 25px 20px;
    }
    
    .method-tabs {
        flex-direction: column;
    }
    
    .method-tab {
        border-radius: 0;
        border-bottom: 1px solid #dee2e6;
    }
    
    .method-tab:first-child {
        border-radius: 6px 6px 0 0;
    }
    
    .method-tab:last-child {
        border-radius: 0 0 6px 6px;
        border-bottom: none;
    }
    
    .verification-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .verification-input input {
        width: 100%;
    }
    
    .backup-codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .backup-codes-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .totp-actions {
        flex-direction: column;
    }
    
    .rat-2fa-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-padding {
        padding: 20px;
    }
    
    .setup-step {
        padding: 20px 15px;
    }
    
    .alternative-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .alternative-options .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .totp-code-input {
        font-size: 20px;
        letter-spacing: 4px;
    }
    
    .backup-codes-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-code-container {
        padding: 15px;
    }
    
    .qr-code-container img {
        max-width: 150px;
    }
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#rat-2fa-pro-container {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#rat-2fa-pro-container h3 {
    margin: 0 0 15px;
    padding: 0;
    color: #23282d;
    font-size: 1.3em;
    font-weight: 600;
}

#rat-2fa-pro-container p {
    margin: 0 0 15px;
    color: #444;
    line-height: 1.5;
}

#rat-2fa-pro-container .description {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

#rat-2fa-pro-container ul {
    margin: 0 0 20px;
    padding-left: 20px;
    color: #444;
}

#rat-2fa-pro-container ul li {
    margin: 5px 0;
    line-height: 1.4;
}

#rat_2fa_pro_code,
#rat_2fa_pro_backup_code {
    width: 100%;
    padding: 12px;
    font-size: 24px;
    letter-spacing: 4px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin: 10px 0;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

#rat_2fa_pro_code:focus,
#rat_2fa_pro_backup_code:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
    background: #fff;
}

#rat_2fa_pro_code:disabled,
#rat_2fa_pro_backup_code:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.rat-2fa-pro-backup-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#rat-2fa-pro-show-backup {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

#rat-2fa-pro-show-backup:hover {
    color: #00a0d2;
    text-decoration: underline;
}

#rat-2fa-pro-backup-form {
    display: none;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}

#rat-2fa-pro-resend {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: all 0.3s ease;
}

#rat-2fa-pro-resend:hover:not(:disabled) {
    background-color: #f0f0f0;
    border-color: #999;
    color: #23282d;
}

#rat-2fa-pro-resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#rat-2fa-pro-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

#rat-2fa-pro-message.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

#rat-2fa-pro-message.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.rat-2fa-pro-session-info {
    margin-top: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

#rat-2fa-pro-countdown {
    font-weight: bold;
    color: #444;
}

/* Loading state */
.rat-2fa-loading {
    position: relative;
    pointer-events: none;
}

.rat-2fa-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007cba;
    border-radius: 50%;
    animation: rat-2fa-spin 0.8s infinite linear;
}

@keyframes rat-2fa-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    #rat_2fa_pro_code,
    #rat_2fa_pro_backup_code {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    #rat-2fa-pro-resend {
        width: 100%;
        text-align: center;
    }
    
    .rat-2fa-pro-session-info {
        font-size: 12px;
    }
} 