/**
 * Custom Account Manager Styles - eCOUNT Design System
 * Version: 2.0.0
 * Aligned with eCOUNT Formulare design system for unified styling
 * eCOUNT CI colors: #4A90E2 (primary), #7ED321 (accent), #e74c3c (error)
 */

/* ================================
   Base Styles and Reset
   ================================ */

.custom-account-sections *,
.cam-section *,
.cam-form * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.custom-account-sections {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    color: #2c3e50;
    color-scheme: light;
}

/* ================================
   Section Cards
   ================================ */

.cam-section {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 40px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cam-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.1);
    border-color: #4A90E2;
}

.cam-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.cam-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #4A90E2, #7ED321);
    border-radius: 3px;
}

/* ================================
   Form Styles
   ================================ */

.cam-form {
    margin: 0;
}

.cam-form-group {
    margin-bottom: 20px;
    position: relative;
}

.cam-form-group.required label::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

.cam-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ================================
   Input Fields
   ================================ */

.cam-form-group input[type="text"],
.cam-form-group input[type="email"],
.cam-form-group input[type="password"],
.cam-form-group input[type="url"],
.cam-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 1rem;
    line-height: 1.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #2c3e50;
    box-sizing: border-box;
}

.cam-form-group input:focus,
.cam-form-group textarea:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-1px);
}

.cam-form-group input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #e9ecef;
    opacity: 0.7;
}

.cam-form-group input::placeholder,
.cam-form-group textarea::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.cam-form-group small {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Field Validation States */
.cam-form-group input.valid,
.cam-form-group textarea.valid {
    border-color: #7ED321;
    box-shadow: 0 0 0 3px rgba(126, 211, 33, 0.1);
}

.cam-form-group input.invalid,
.cam-form-group textarea.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ================================
   Textarea
   ================================ */

.cam-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ================================
   Checkboxes
   ================================ */

.cam-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.cam-checkbox-group:hover {
    border-color: #4A90E2;
    background: linear-gradient(135deg, #f0f8ff, #ffffff);
}

.cam-checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
    color: #2c3e50;
}

.cam-checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 4px 0 0 0;
    transform: scale(1.2);
    accent-color: #4A90E2;
}

/* ================================
   Buttons
   ================================ */

.cam-btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    text-align: center;
    color: white;
}

.cam-btn:disabled {
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
    pointer-events: none;
}

.cam-btn-primary {
    background: linear-gradient(135deg, #4A90E2, #2E5BBA);
    color: white;
}

.cam-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2E5BBA, #1e4ba8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

.cam-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

/* ================================
   Loading States
   ================================ */

.cam-btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.cam-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: cam-spin 0.8s linear infinite;
}

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

/* ================================
   Messages and Notifications
   ================================ */

.cam-message {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: 3px;
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease;
    transition: all 0.3s ease;
}

.cam-message.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #7ED321;
}

.cam-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #e74c3c;
}

.cam-message.warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.cam-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.cam-message.show {
    display: block;
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Global Messages */
.cam-global-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 3px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.cam-global-message:hover {
    transform: translateX(-5px);
}

.cam-global-message.success {
    background: rgba(212, 237, 218, 0.95);
    color: #155724;
    border-left-color: #7ED321;
}

.cam-global-message.error {
    background: rgba(248, 215, 218, 0.95);
    color: #721c24;
    border-left-color: #e74c3c;
}

.cam-global-message.warning {
    background: rgba(255, 243, 205, 0.95);
    color: #856404;
    border-left-color: #ffc107;
}

.cam-global-message.info {
    background: rgba(209, 236, 241, 0.95);
    color: #0c5460;
    border-left-color: #17a2b8;
}

.cam-message-icon {
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 8px;
    flex-shrink: 0;
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* ================================
   Password Strength Indicator
   ================================ */

.cam-password-strength {
    margin-top: 8px;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.cam-password-strength::before {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
}

.cam-password-strength::after {
    content: attr(title);
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cam-password-strength.weak::before {
    width: 25%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.cam-password-strength.weak::after {
    content: 'Schwach';
    color: #e74c3c;
}

.cam-password-strength.fair::before {
    width: 50%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.cam-password-strength.fair::after {
    content: 'Akzeptabel';
    color: #f39c12;
}

.cam-password-strength.good::before {
    width: 75%;
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.cam-password-strength.good::after {
    content: 'Gut';
    color: #3498db;
}

.cam-password-strength.strong::before {
    width: 100%;
    background: linear-gradient(90deg, #7ED321, #27ae60);
}

.cam-password-strength.strong::after {
    content: 'Stark';
    color: #7ED321;
}

/* ================================
   Login Required Message
   ================================ */

.cam-login-required {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 3px;
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
}

.cam-login-required::before {
    content: '🔒';
    display: block;
    font-size: 2rem;
    margin-bottom: 15px;
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    .custom-account-sections {
        padding: 10px;
    }
    
    .cam-section {
        padding: 30px 20px;
        margin-bottom: 20px;
        border-radius: 3px;
    }
    
    .cam-section h3 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    .cam-form-group {
        margin-bottom: 18px;
    }
    
    .cam-btn {
        width: 100%;
        min-width: auto;
        padding: 16px;
        font-size: 1rem;
    }
    
    .cam-checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px;
    }
    
    .cam-global-message {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
        border-radius: 3px;
    }
}

@media (max-width: 480px) {
    .cam-section {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .cam-section h3 {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }
    
    .cam-form-group input,
    .cam-form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
    }
    
    .cam-btn {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .cam-password-strength::after {
        font-size: 0.7rem;
        top: -22px;
    }
}

/* ================================
   Enhanced Form Focus States
   ================================ */

.cam-form-group input:focus,
.cam-form-group textarea:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-1px);
}

/* Accessibility - Focus visible for keyboard navigation */
.cam-btn:focus-visible,
.cam-form input:focus-visible,
.cam-form textarea:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* ================================
   Enhanced Hover Effects
   ================================ */

.cam-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

.cam-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

/* ================================
   Professional Typography
   ================================ */

.cam-section h3 {
    letter-spacing: -0.02em;
}

.cam-form-group label {
    letter-spacing: 0.01em;
}

/* ================================
   Animation Improvements
   ================================ */

.cam-section {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Dark Mode Override - Force Light Theme
   ================================ */

.custom-account-sections,
.custom-account-sections *,
.cam-section,
.cam-section *,
.cam-form,
.cam-form * {
    color-scheme: light !important;
}

.custom-account-sections {
    background: transparent !important;
    color: #2c3e50 !important;
}

.cam-section {
    background: #ffffff !important;
    color: #2c3e50 !important;
    border-color: #e9ecef !important;
}

.cam-form-group input,
.cam-form-group textarea {
    background: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #2c3e50 !important;
}

.cam-form-group input::placeholder,
.cam-form-group textarea::placeholder {
    color: #6c757d !important;
    opacity: 0.7 !important;
}

.cam-form-group label {
    color: #2c3e50 !important;
}

.cam-form-group small {
    color: #7f8c8d !important;
}

/* ================================
   Print Styles
   ================================ */

@media print {
    .cam-section {
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .cam-btn {
        background: #666 !important;
        color: white !important;
    }
    
    .cam-global-message {
        position: static !important;
        margin-bottom: 20px;
    }
    
    .cam-password-strength {
        display: none;
    }
}

/* ================================
   High Contrast Mode Support
   ================================ */

@media (prefers-contrast: high) {
    .cam-section {
        border: 2px solid #000;
    }
    
    .cam-form-group input,
    .cam-form-group textarea {
        border: 2px solid #000;
    }
    
    .cam-btn-primary {
        background: #000 !important;
        border: 2px solid #000;
    }
}