/* QDI Messenger - Authentication Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1e1e1e 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.auth-form {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: none;
}

.auth-form.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
    animation: slideIn 0.3s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.auth-header p {
    color: #999;
    font-size: 14px;
    line-height: 1.4;
}

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

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #25D366;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-group input::placeholder {
    color: #666;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #25D366;
}

.error-message {
    display: block;
    color: #ff4757;
    font-size: 12px;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.auth-btn {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.auth-btn:hover:not(.loading) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn.loading {
    cursor: not-allowed;
    opacity: 0.8;
}

.auth-btn .btn-text {
    transition: opacity 0.2s ease;
}

.auth-btn.loading .btn-text {
    opacity: 0;
}

.loading-spinner {
    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: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.auth-btn.loading .loading-spinner {
    display: block;
}

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

.auth-footer {
    text-align: center;
    color: #999;
    font-size: 14px;
}

.auth-footer a {
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: #34B7F1;
    text-decoration: underline;
}

.auth-footer p {
    margin-bottom: 8px;
}

/* Demo Accounts Section */
.demo-accounts {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-accounts h3 {
    color: #25D366;
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.demo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.demo-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    border: 1px solid transparent;
}

.demo-item:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
    transform: translateY(-1px);
}

.demo-note {
    text-align: center;
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 300px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 8px;
    color: #ffffff;
}

.toast-success .toast-content {
    background: #25D366;
}

.toast-error .toast-content {
    background: #ff4757;
}

.toast-warning .toast-content {
    background: #ffa726;
}

.toast-info .toast-content {
    background: #34B7F1;
}

.toast-icon {
    margin-right: 8px;
    font-size: 16px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .auth-form {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
    }
}

/* Loading overlay for future use */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}