/* ============================================
   LOGIN PAGE STYLES
   Sistema de Manutenção Preditiva
   ============================================ */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
}

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

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

/* Background Animation */
.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    z-index: 1;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(0, 50px) scale(0.9);
    }
    75% {
        transform: translate(-50px, -25px) scale(1.05);
    }
}

/* Login Card */
.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease-out;
}

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

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    color: var(--primary-color);
    animation: pulse 2s infinite ease-in-out;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
    background: var(--bg-primary);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--primary-color);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

/* Password Toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remember-me input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Buttons */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* OAuth Button */
.btn-oauth {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-oauth:hover {
    background: var(--bg-primary);
    border-color: var(--text-light);
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 16px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-footer {
    margin-top: 24px;
    text-align: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: var(--bg-secondary);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.dashboard-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.dashboard-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.dashboard-option.energy {
    --option-color: #f59e0b;
}

.dashboard-option.vibration {
    --option-color: #10b981;
}

.dashboard-option .icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--option-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.dashboard-option .info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-option .info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .modal-content {
        padding: 24px;
    }

    .dashboard-option {
        padding: 16px;
    }

    .dashboard-option .icon {
        width: 40px;
        height: 40px;
    }
}

/* Success State */
.login-card.success {
    border: 2px solid var(--secondary-color);
}

.login-card.success .logo {
    color: var(--secondary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    gap: 16px;
}

.loading-overlay .spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   LOGIN TABS
   ============================================ */
.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn svg {
    flex-shrink: 0;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* OAuth Tab Styles */
.oauth-info {
    text-align: center;
    margin-bottom: 20px;
}

.oauth-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

#tab-oauth .btn-oauth {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
}

#tab-oauth .btn-oauth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* OAuth Tab - Secondary Button */
#tab-oauth .btn-oauth-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
}

#tab-oauth .btn-oauth-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-light);
    transform: none;
    box-shadow: none;
}

/* OAuth Divider */
.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.oauth-divider span {
    padding: 0 12px;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* OAuth Note */
.oauth-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 12px;
}

/* Test Login Tab Styles */
.test-info {
    text-align: center;
    margin-bottom: 16px;
}

.test-info p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
}

.test-credentials {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.test-credentials code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Test Account Selector */
.test-account-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.test-account-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.test-account-btn:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.test-account-btn.active {
    color: var(--primary-color);
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.test-account-btn[data-account="vibration"].active {
    color: var(--secondary-color);
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary-color);
}

.test-account-btn[data-account="energy"].active {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
}

/* Responsive for tabs */
@media (max-width: 480px) {
    .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .tab-btn svg {
        width: 14px;
        height: 14px;
    }
}
