/* Modern Login 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, var(--primary-color-start) 0%, var(--primary-color-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Corrige SVGs sumindo: garante visibilidade de todos SVGs no login */
svg, .input-icon, .alert-icon {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    animation: bgPulse 6s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { 
        filter: brightness(1) hue-rotate(0deg);
        transform: scale(1);
    }
    100% { 
        filter: brightness(1.1) hue-rotate(5deg);
        transform: scale(1.02);
    }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite linear;
    transition: all 0.3s ease;
}

.shape:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation: float 20s infinite linear, pulse1 4s infinite ease-in-out;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    left: 70%;
    animation: float 25s infinite linear, pulse2 5s infinite ease-in-out;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 10%;
    right: 10%;
    animation: float 18s infinite linear, pulse3 3.5s infinite ease-in-out;
    animation-delay: -10s;
}

.shape:nth-child(4) {
    width: 90px;
    height: 90px;
    bottom: 20%;
    left: 20%;
    animation: float 22s infinite linear, pulse1 4.5s infinite ease-in-out;
    animation-delay: -15s;
}

.shape:nth-child(5) {
    width: 110px;
    height: 110px;
    bottom: 30%;
    right: 30%;
    animation: float 24s infinite linear, pulse2 6s infinite ease-in-out;
    animation-delay: -8s;
}

@keyframes pulse1 {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes pulse2 {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes pulse3 {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    25% { transform: translateY(-20px) rotate(90deg); opacity: 1; }
    50% { transform: translateY(-10px) rotate(180deg); opacity: 0.8; }
    75% { transform: translateY(-30px) rotate(270deg); opacity: 0.9; }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    margin: auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 48px 40px;
    width: 100%;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    animation: cardEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: cardShimmer 3s ease-in-out 2s infinite;
}

@keyframes cardEntrance {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.login-card:hover {
    transform: translateY(-2px) scale(1);
    box-shadow: 
        0 35px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color-start), var(--primary-color-end));
    border-radius: 24px 24px 0 0;
    animation: headerGlow 2s ease-in-out infinite alternate;
}

@keyframes headerGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    margin-bottom: 0;
    opacity: 0;
    animation: fadeInLogo 1s ease-out 0.8s forwards;
    text-align: center;
}


@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.logo {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.1));
}

@keyframes fadeInLogo {
    to { opacity: 1; }
}

.login-title {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeInTitle 1s ease-out 0.8s forwards;
}

.login-subtitle {
    color: #666;
    font-size: 12px;
    font-weight: 400;
    opacity: 0;
    animation: fadeInSubtitle 1s ease-out 1s forwards;
}

@keyframes fadeInTitle {
    to { opacity: 1; }
}

@keyframes fadeInSubtitle {
    to { opacity: 1; }
}

/* Form Styles */
.login-form {
    opacity: 0;
    animation: fadeInForm 1s ease-out 1.2s forwards;
}

@keyframes fadeInForm {
    to { opacity: 1; }
}

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

.login-form .form-label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s;
    margin-bottom: 4px;
    margin-left: 4px;
    font-size: 12px;
}

.form-input {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
}

.form-input:focus {
    border-color: var(--primary-color-start);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 4px 20px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.form-input:focus + .form-label {
    color: var(--primary-color-start);
}

/* Input Icons */
.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: color 0.2s;
    pointer-events: none;
    z-index: 5;
}

.form-input:focus ~ .input-icon {
    color: var(--primary-color-start);
}

/* Login Button */
.login-button {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color-start) 0%, var(--primary-color-end) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 30px rgba(59, 130, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-button:hover::before {
    left: 100%;
}

.login-button:active {
    transform: translateY(0);
}

.login-button .btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button .btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.login-button:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading State */
.login-button.loading {
    pointer-events: none;
}

.login-button.loading .btn-text {
    opacity: 0;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transform: translateY(-10px);
    opacity: 0;
    animation: slideInAlert 0.4s ease-out forwards;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

@keyframes slideInAlert {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.95) !important;
    color: #fff !important;
    border: 2px solid #dc2626 !important;
    box-shadow: 0 8px 32px rgba(239,68,68,0.18) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2000 !important;
}

.alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    z-index: 1001;
    position: relative;
    color: inherit;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Browser Warning */
.browser-warning {
    text-align: center;
    padding: 40px;
}

.warning-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: #f59e0b;
    opacity: 0;
    animation: bounceIn 0.6s ease-out 0.3s forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.warning-title {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.warning-text {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.browser-options {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
}

.browser-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    color: #374151;
    font-weight: 500;
}

.browser-link:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.browser-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .form-input,
    .login-button {
        height: 48px;
    }
    
    .logo-svg {
        width: 150px;
    }
    
    .browser-options {
        flex-direction: column;
        align-items: center;
    }
    
    .shape {
        display: none; /* Hide floating shapes on mobile for performance */
    }
}

@media (max-height: 600px) {
    .login-container {
        min-height: auto;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .login-card {
        padding: 32px;
    }
    
    .logo-svg {
        width: 120px;
    }
    
    .login-header {
        margin-bottom: 24px;
    }
}

/* System Info */
.system-info {
    text-align: center;
    margin-top: 24px;
    opacity: 0;
    animation: fadeInInfo 1s ease-out 1.8s forwards;
}

.system-info-text {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

@keyframes fadeInInfo {
    to { opacity: 1; }
}