/* Copyright 2025 My2Open Authors */
/* QR Login Styles */

/* Login Page Layout */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Login Card */
.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
.login-header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.brand {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.brand-icon {
    font-size: 32px;
    margin-right: 8px;
}

.brand-text {
    vertical-align: middle;
}

.subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Tabs */
.login-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.tab-icon {
    font-size: 18px;
}

/* Login Panels */
.login-panel {
    display: none;
    padding: 30px;
    animation: slideIn 0.3s ease-out;
}

.login-panel.active {
    display: block;
}

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

/* QR Code Section */
.qr-content {
    text-align: center;
}

.qr-wrapper {
    position: relative;
    margin: 20px auto;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-container {
    width: 256px;
    height: 256px;
    padding: 12px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-container canvas {
    display: block !important;
    margin: 0 auto !important;
}

/* Loading State */
.qr-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status Messages */
.qr-status {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.qr-status.hidden {
    display: none;
}

.status-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.status-text {
    margin: 0;
    font-size: 16px;
    color: #495057;
    text-align: center;
}

/* Instructions */
.qr-instructions {
    margin: 24px 0;
    text-align: left;
}

.qr-instructions h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 12px 0;
}

.qr-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
}

.qr-instructions li {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Timer and Refresh */
.qr-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.qr-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.countdown {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
    min-width: 40px;
}

.countdown.warning {
    color: #fd7e14;
}

.countdown.danger {
    color: #dc3545;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: #667eea;
    color: white;
}

.btn-refresh.hidden {
    display: none;
}

/* Password Form */
.password-content {
    max-width: 360px;
    margin: 0 auto;
}

.info-message {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

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

.form-group input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.btn-primary {
    padding: 12px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.btn-primary .btn-loading {
    display: inline-flex;
    align-items: center;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.form-error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #c53030;
}

.form-error .error-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Footer */
.login-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.copyright {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

.language-switch {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.lang-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        border-radius: 12px;
    }
    
    .login-header {
        padding: 30px 20px 20px;
    }
    
    .login-panel {
        padding: 20px;
    }
    
    .qr-wrapper {
        width: 240px;
        height: 240px;
    }
    
    .qr-container {
        width: 220px;
        height: 220px;
    }
    
    .login-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can add dark mode styles here if needed */
}
