/* Modern User Profiles - Authentication Styles */

/* Authentication Container */
.mup-auth-container {
    max-width: 500px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.mup-auth-card {
    background: var(--mup-bg-primary, #ffffff);
    border-radius: var(--mup-radius-xl, 1rem);
    box-shadow: var(--mup-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    transition: var(--mup-transition, all 0.2s ease-in-out);
}

.mup-auth-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

/* Auth Header */
.mup-auth-header {
    background: linear-gradient(135deg, var(--mup-primary, #2563eb) 0%, var(--mup-primary-hover, #1d4ed8) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mup-auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

.mup-auth-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.mup-auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Auth Tabs */
.mup-auth-tabs-nav {
    display: flex;
    background: var(--mup-bg-secondary, #f8fafc);
    border-bottom: 1px solid var(--mup-border, #e2e8f0);
}

.mup-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--mup-text-secondary, #64748b);
    transition: var(--mup-transition, all 0.2s ease-in-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mup-tab-btn:hover {
    background: var(--mup-bg-tertiary, #f1f5f9);
    color: var(--mup-text-primary, #1e293b);
}

.mup-tab-btn.active {
    background: var(--mup-bg-primary, #ffffff);
    color: var(--mup-primary, #2563eb);
    border-bottom: 2px solid var(--mup-primary, #2563eb);
}

.mup-tab-btn .dashicons {
    font-size: 1.25rem;
}

/* Tab Content */
.mup-auth-tabs-content {
    position: relative;
}

.mup-tab-content {
    display: none;
    padding: 2rem;
}

.mup-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Auth Form */
.mup-auth-form {
    margin: 20px;
}

.mup-form-group {
    margin-bottom: 1.5rem;
}

.mup-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mup-form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--mup-text-primary, #1e293b);
    font-size: 0.875rem;
}

.mup-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--mup-border, #e2e8f0);
    border-radius: var(--mup-radius-md, 0.5rem);
    font-size: 1rem;
    transition: var(--mup-transition, all 0.2s ease-in-out);
    background: var(--mup-bg-primary, #ffffff);
    color: var(--mup-text-primary, #1e293b);
}

.mup-form-input:focus {
    outline: none;
    border-color: var(--mup-border-focus, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mup-form-input.mup-error {
    border-color: var(--mup-error, #ef4444);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.mup-form-input.mup-success {
    border-color: var(--mup-success, #10b981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.mup-form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--mup-text-secondary, #64748b);
}

/* Password Input */
.mup-password-input {
    position: relative;
}

.mup-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mup-text-secondary, #64748b);
    padding: 0.25rem;
    border-radius: var(--mup-radius-sm, 0.375rem);
    transition: var(--mup-transition, all 0.2s ease-in-out);
}

.mup-password-toggle:hover {
    background: var(--mup-bg-secondary, #f8fafc);
    color: var(--mup-text-primary, #1e293b);
}

.mup-password-toggle .dashicons {
    font-size: 1.25rem;
}

/* Password Strength */
.mup-password-strength {
    margin-top: 0.5rem;
}

.mup-strength-bar {
    width: 100%;
    height: 4px;
    background: var(--mup-border, #e2e8f0);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.mup-strength-fill {
    height: 100%;
    width: 0;
    background: #ccc;
    transition: all 0.3s ease-in-out;
}

.mup-strength-text {
    font-size: 0.75rem;
    color: var(--mup-text-secondary, #64748b);
}

/* Checkbox */
.mup-checkbox-group {
    margin-bottom: 1rem;
}

.mup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--mup-text-primary, #1e293b);
    line-height: 1.5;
}

.mup-checkbox-label input[type="checkbox"] {
    display: none;
}

.mup-checkbox-custom {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--mup-border, #e2e8f0);
    border-radius: var(--mup-radius-sm, 0.375rem);
    background: var(--mup-bg-primary, #ffffff);
    position: relative;
    flex-shrink: 0;
    margin-top: 0.125rem;
    transition: var(--mup-transition, all 0.2s ease-in-out);
}

.mup-checkbox-label input[type="checkbox"]:checked + .mup-checkbox-custom {
    background: var(--mup-primary, #2563eb);
    border-color: var(--mup-primary, #2563eb);
}

.mup-checkbox-label input[type="checkbox"]:checked + .mup-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Buttons */
.mup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--mup-radius-md, 0.5rem);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--mup-transition, all 0.2s ease-in-out);
    position: relative;
    overflow: hidden;
}

.mup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mup-btn-primary {
    background: var(--mup-primary, #2563eb);
    color: white;
}

.mup-btn-primary:hover:not(:disabled) {
    background: var(--mup-primary-hover, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mup-btn-secondary {
    background: var(--mup-bg-secondary, #f8fafc);
    color: var(--mup-text-primary, #1e293b);
    border: 1px solid var(--mup-border, #e2e8f0);
}

.mup-btn-secondary:hover:not(:disabled) {
    background: var(--mup-bg-tertiary, #f1f5f9);
    border-color: var(--mup-text-secondary, #64748b);
}

.mup-btn-full {
    width: 100%;
}

.mup-btn-loading {
    display: none;
}

.mup-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Messages */
.mup-auth-messages {
    margin-top: 1rem;
}

.mup-message {
    padding: 0.75rem 1rem;
    border-radius: var(--mup-radius-md, 0.5rem);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mup-message-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--mup-success, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.mup-message-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--mup-error, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1rem 1.25rem;
    border-radius: var(--mup-radius-md, 0.5rem);
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.mup-message-error::before {
    content: "⚠️";
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.mup-message-error strong {
    font-weight: 600;
    color: #dc2626;
}

.mup-message-error .error-details {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.mup-message-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--mup-warning, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Auth Footer */
.mup-auth-footer {
    padding: 1.5rem 2rem;
    background: var(--mup-bg-secondary, #f8fafc);
    border-top: 1px solid var(--mup-border, #e2e8f0);
    text-align: center;
}

.mup-auth-links {
    margin: 0 0 1rem 0;
}

.mup-auth-links a {
    color: var(--mup-primary, #2563eb);
    text-decoration: none;
    font-size: 0.875rem;
}

.mup-auth-links a:hover {
    text-decoration: underline;
}

.mup-auth-switch {
    margin: 0;
    font-size: 0.875rem;
    color: var(--mup-text-secondary, #64748b);
}

.mup-auth-switch a {
    color: var(--mup-primary, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.mup-auth-switch a:hover {
    text-decoration: underline;
}

/* Logged In State */
.mup-auth-logged-in {
    text-align: center;
    padding: 2rem;
}

.mup-auth-welcome h3 {
    margin: 0 0 0.5rem 0;
    color: var(--mup-text-primary, #1e293b);
    font-size: 1.5rem;
}

.mup-auth-welcome p {
    margin: 0 0 1.5rem 0;
    color: var(--mup-text-secondary, #64748b);
}

.mup-auth-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Forgot Password Styles */
.mup-forgot-password-container {
    max-width: 500px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.mup-form-step {
    transition: var(--mup-transition, all 0.3s ease-in-out);
}

.mup-form-step:not(:first-child) {
    animation: slideInUp 0.3s ease-out;
}

.mup-form-help {
    font-size: 0.875rem;
    color: var(--mup-text-secondary, #64748b);
    margin-top: 0.5rem;
    font-style: italic;
}

/* OTP Input Styling */
#otp {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 0.5rem;
    font-weight: 600;
}

/* Password Strength Indicator */
.mup-password-strength {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--mup-radius, 0.375rem);
    font-size: 0.875rem;
    font-weight: 500;
}

.mup-password-strength.weak {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.mup-password-strength.medium {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.mup-password-strength.strong {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Animation for form steps */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mup-auth-container {
        margin: 1rem;
        max-width: none;
    }
    
    .mup-auth-card {
        border-radius: var(--mup-radius-lg, 0.75rem);
    }
    
    .mup-auth-header {
        padding: 1.5rem;
    }
    
    .mup-auth-header h2 {
        font-size: 1.5rem;
    }
    
    .mup-tab-content {
        padding: 1.5rem;
    }
    
    .mup-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .mup-auth-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .mup-auth-actions .mup-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .mup-auth-header {
        padding: 1rem;
    }
    
    .mup-tab-content {
        padding: 1rem;
    }
    
    .mup-auth-footer {
        padding: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mup-auth-card {
        background: var(--mup-bg-primary, #1e293b);
        border: 1px solid var(--mup-border, #475569);
    }
    
    .mup-form-input {
        background: var(--mup-bg-secondary, #334155);
        border-color: var(--mup-border, #475569);
        color: var(--mup-text-primary, #f1f5f9);
    }
    
    .mup-form-input:focus {
        border-color: var(--mup-border-focus, #3b82f6);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    .mup-auth-footer {
        background: var(--mup-bg-secondary, #334155);
        border-color: var(--mup-border, #475569);
    }
    
    .mup-tab-btn {
        background: var(--mup-bg-secondary, #334155);
        color: var(--mup-text-secondary, #cbd5e1);
    }
    
    .mup-tab-btn:hover {
        background: var(--mup-bg-tertiary, #475569);
        color: var(--mup-text-primary, #f1f5f9);
    }
    
    .mup-tab-btn.active {
        background: var(--mup-bg-primary, #1e293b);
        color: var(--mup-primary, #3b82f6);
    }
}

/* Form validation styles for forgot password */
.mup-form-step input:invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.mup-form-step input:focus {
    border-color: var(--mup-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Step indicator for multi-step forms */
.mup-step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.mup-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s ease;
}

.mup-step-dot.active {
    background: var(--mup-primary, #667eea);
    transform: scale(1.2);
}

.mup-step-dot.completed {
    background: #10b981;
}

/* Enhanced form step transitions */
.mup-form-step {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-in-out;
}

.mup-form-step[style*="display: none"] {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Already logged in message styles */
.mup-auth-content {
    text-align: center;
    padding: 20px;
    padding-top: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
}

/* OTP Form Styles */
.mup-otp-email-form,
.mup-otp-code-form {
    margin-top: 1rem;
}

.mup-otp-email-form .mup-form-group,
.mup-otp-code-form .mup-form-group {
    margin-bottom: 1.5rem;
}

.mup-otp-email-form label,
.mup-otp-code-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.mup-otp-email-form input,
.mup-otp-code-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.mup-otp-email-form input:focus,
.mup-otp-code-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mup-otp-code-form input[type="text"][pattern] {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 0.5rem;
}

/* Success and Error Messages */
.mup-success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.mup-error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.mup-auth-content p {
    margin-bottom: 1rem;
    color: var(--mup-text, #6b7280);
    font-size: 1rem;
}

.mup-auth-content a {
    color: var(--mup-primary, #667eea);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mup-auth-content a:hover {
    color: var(--mup-primary-dark, #5a67d8);
    text-decoration: underline;
}

/* Prevent form validation on hidden fields */
.mup-form-step[style*="display: none"] input,
.mup-form-step[style*="display: none"] select,
.mup-form-step[style*="display: none"] textarea {
    display: none !important;
}

/* Alternative approach - disable validation on hidden fields */
.mup-form-step[style*="display: none"] input[required],
.mup-form-step[style*="display: none"] select[required],
.mup-form-step[style*="display: none"] textarea[required] {
    required: false;
}

/* Debug Logout Styles */
.mup-debug-logout {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mup-debug-logout h3 {
    color: #1e293b;
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 0.5rem;
}

.mup-debug-logout h4 {
    color: #374151;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.mup-debug-content p {
    margin: 0.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
}

.mup-debug-content strong {
    color: #1f2937;
    font-weight: 600;
}

.mup-debug-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 1rem 0;
}

.mup-debug-logout .mup-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.mup-debug-logout .mup-btn-primary {
    background: #3b82f6;
    color: white;
}

.mup-debug-logout .mup-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.mup-debug-logout .mup-btn-secondary {
    background: #6b7280;
    color: white;
}

.mup-debug-logout .mup-btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
} 