/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #475569 75%, #64748b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decoração de fundo animada */
.background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(14, 116, 144, 0.1);
    animation: float 8s ease-in-out infinite;
    backdrop-filter: blur(1px);
}

.floating-shape:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    background: rgba(14, 116, 144, 0.08);
}

.floating-shape:nth-child(2) {
    width: 180px;
    height: 180px;
    top: 60%;
    right: 15%;
    animation-delay: 3s;
    background: rgba(6, 95, 70, 0.08);
}

.floating-shape:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 15%;
    animation-delay: 6s;
    background: rgba(14, 116, 144, 0.06);
}

.floating-shape:nth-child(4) {
    width: 140px;
    height: 140px;
    top: 25%;
    right: 25%;
    animation-delay: 1.5s;
    background: rgba(6, 95, 70, 0.06);
}

.floating-shape:nth-child(5) {
    width: 90px;
    height: 90px;
    top: 70%;
    left: 60%;
    animation-delay: 4.5s;
    background: rgba(14, 116, 144, 0.05);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-15px) rotate(90deg) scale(1.05);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-25px) rotate(180deg) scale(1.1);
        opacity: 1;
    }
    75% {
        transform: translateY(-10px) rotate(270deg) scale(1.05);
        opacity: 0.8;
    }
}

/* Container principal do login */
.login-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container:hover {
    transform: translateY(-8px);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Logo e branding */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: inline-block;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.1), rgba(6, 95, 70, 0.1));
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

.company-logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.welcome-text {
    color: #1e293b;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

/* Mensagens de erro */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #059669;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

/* Formulário */
.login-form {
    margin-bottom: 32px;
}

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

.form-label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
}

.form-input:focus {
    outline: none;
    border-color: #0e7490;
    box-shadow:
        0 0 0 4px rgba(14, 116, 144, 0.1),
        0 4px 12px rgba(14, 116, 144, 0.15);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.form-input:hover:not(:focus) {
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 1);
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Estado de erro nos inputs */
.form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.02);
}

.form-input.error:focus {
    border-color: #ef4444;
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Botão de login */
.login-button {
    width: 100%;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 100%);
    color: white;
    padding: 18px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.25);
}

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

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(14, 116, 144, 0.35);
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 25%, #22d3ee 100%);
}

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

.login-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.25);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.25);
}

/* Loading state */
.login-button.loading {
    position: relative;
    color: transparent;
}

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

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Links adicionais */
.additional-links {
    text-align: center;
    margin-top: 24px;
}

.additional-links a {
    color: #0e7490;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.additional-links a:hover {
    color: #0891b2;
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 640px) {
    .login-container {
        margin: 20px;
        padding: 32px 24px;
        border-radius: 20px;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .company-logo {
        width: 100px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom no iOS */
    }

    .login-button {
        padding: 16px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .login-container {
        margin: 0;
        padding: 28px 20px;
    }

    .floating-shape {
        display: none; /* Simplifica em telas muito pequenas */
    }
}

/* Estados de foco e acessibilidade */
.login-button:focus-visible,
.form-input:focus-visible {
    outline: 2px solid #0e7490;
    outline-offset: 2px;
}

/* Animação de entrada da página */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Melhorias para dispositivos com hover */
@media (hover: hover) and (pointer: fine) {
    .form-input:hover {
        border-color: #cbd5e1;
    }

    .login-button:hover {
        transform: translateY(-3px);
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    /* Pode ser implementado futuramente */
}
