/* ===========================================
   AUTH MODULE - LOGIN STYLES
   Specifické styly pro autentifikaci
   =========================================== */

.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.auth-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.back-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: white;
    text-decoration: underline;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.auth-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 500;
}

.auth-tab:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.auth-tab.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}

/* Auth Forms */
.auth-form {
    display: none;
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

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

.auth-form .card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-large);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
}

.auth-form .card-header {
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    text-align: center;
}

/* Demo Accounts */
.auth-demo {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-demo h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.demo-accounts {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.demo-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

/* Form Enhancements */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-hint);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Server Status */
.auth-status {
    margin-top: 2rem;
    text-align: center;
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.status-indicator {
    font-size: 1rem;
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    animation: slideIn 0.3s ease;
    position: relative;
}

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

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Form Validation States */
.form-input:valid {
    border-color: var(--success-color);
}

.form-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--error-color);
}

.form-group.has-error .form-input {
    border-color: var(--error-color);
}

.form-group.has-success .form-input {
    border-color: var(--success-color);
}

.error-message {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--error-color);
}

/* Reset Password - Type Selection */
.reset-type-selection {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.reset-type-selection h4 {
    margin: 0 0 1rem 0;
    color: #fff;
    font-size: 1.1rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #fff;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 87, 34, 0.3);
    transform: translateY(-1px);
}

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

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-label input[type="radio"]:checked {
    background: rgba(255, 87, 34, 0.1);
}

/* Password Reset Forms */
#change-password-form {
    animation: slideIn 0.3s ease-out;
}

#forgot-password-form {
    animation: slideIn 0.3s ease-out;
}

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

/* Loading States */
.auth-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }
    
    .auth-header h1 {
        font-size: 2.5rem;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .auth-tab {
        text-align: center;
    }
    
    .demo-accounts {
        flex-direction: column;
        align-items: center;
    }
    
    .notifications-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-form {
        max-width: 100%;
    }
    
    .auth-form .card {
        margin: 0 0.5rem 1rem 0.5rem;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .auth-form .card {
        background: rgba(30, 30, 30, 0.95);
        color: var(--text-primary);
    }
    
    .auth-form .card-header {
        background: rgba(255,255,255,0.05);
    }
}

/* Print Styles */
@media print {
    .auth-container {
        background: white;
        color: black;
    }
    
    .auth-tabs,
    .auth-demo,
    .auth-status,
    .notifications-container {
        display: none;
    }
}

/* API Test Section */
.api-test-section {
    margin-top: 1rem;
    text-align: center;
}

.api-test-section .btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
}

.test-results {
    margin-top: 0.8rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.test-results h4 {
    color: white;
    margin-bottom: 0.5rem;
    text-align: center;
}

.test-results p {
    margin: 0.3rem 0;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.test-results p:last-child {
    border-bottom: none;
    font-weight: bold;
    text-align: center;
    margin-top: 0.5rem;
}

/* ===========================================
   TERMS OF SERVICE MODAL
   =========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content {
    padding: 0;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.terms-content {
    padding: 2rem;
    color: #333;
    line-height: 1.6;
}

.terms-content h4 {
    color: #667eea;
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.terms-content h4:first-child {
    margin-top: 0;
}

.terms-content p {
    margin: 0.8rem 0;
}

.terms-content ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.terms-content li {
    margin: 0.5rem 0;
}

.terms-content strong {
    color: #764ba2;
    font-weight: 600;
}

.terms-footer {
    background: rgba(102, 126, 234, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.terms-footer p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.terms-footer em {
    color: #667eea;
    font-weight: 500;
}

.modal-actions {
    background: rgba(248, 249, 250, 0.8);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-actions .btn {
    min-width: 120px;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .terms-content {
        padding: 1.5rem;
    }
    
    .modal-actions {
        padding: 1rem;
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Custom scrollbar for modal content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}
