/* Reset e variáveis globais com cores mais vibrantes */
:root {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #f3fef3;
    --text-color: #374151;
    --light-text: #6b7280;
    --dark-text: #1f2937;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --success-color: #10b981;
    --background: #f0f8f5;
    --card-background: #ffffff;
    --input-background: #f9fafb;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s ease;
    --gradient-bg: linear-gradient(135deg, #f0f8f5 0%, #dbeee6 50%, #c5e0d5 100%);
    --card-border: rgba(255, 255, 255, 0.4);
    --glow: 0 0 15px rgba(16, 185, 129, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background);
    background-image: var(--gradient-bg);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 1s ease-in-out;
    position: relative;
}

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

/* Elementos de formulário com glassmorphism e efeitos de hover aprimorados */
.login-card,
.register-card {
    background-color: var(--card-background);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 36px;
    width: 100%;
    position: relative;
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: var(--transition);
}

.login-card:hover,
.register-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow), var(--glow);
}

.login-card:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

.register-card {
    max-width: 560px;
}

.brand {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    justify-content: center;
    position: relative;
    flex-direction: column;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    border-radius: 20px;
    margin-right: 0;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
    transform: rotate(0deg);
    transition: transform 0.6s ease;
}


.logo i {
    color: white;
    font-size: 36px;
}

.brand h1 {
    color: var(--dark-text);
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5rem;
    color: var(--dark-text);
    text-align: center;
    margin-bottom: 32px;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 3px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 28px;
}

.form-row .input-group {
    margin-bottom: 0;
}

.full-width {
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.3rem;
    transition: var(--transition);
}

input:focus + .input-icon {
    color: var(--primary-hover);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

input, select {
    width: 100%;
    padding: 18px 18px 18px 54px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 1.05rem;
    background-color: var(--input-background);
    color: var(--text-color);
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

input:focus, 
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

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

input:focus::placeholder {
    opacity: 0.5;
    transform: translateX(5px);
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    background-color: rgba(240, 240, 240, 0.5);
    border-radius: 50%;
}

.password-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 5px;
    margin-bottom: 16px;
    display: none;
    animation: shake 0.5s ease-in-out;
    padding-left: 5px;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-message.visible {
    display: block;
}

/* Botões aprimorados */
.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 10px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primary-hover);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-primary:hover:before {
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

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

.btn-primary i {
    transition: transform 0.5s ease;
}

.btn-primary:hover i {
    transform: translateX(8px);
    animation: moveArrow 0.5s ease;
}

@keyframes moveArrow {
    0% { transform: translateX(0); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(8px); }
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
    border: 2px solid transparent;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Links e rodapé melhorados */
.form-footer {
    margin-top: 28px;
    text-align: center;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    display: inline-block;
    margin: 16px 0;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
}

.forgot-password:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.forgot-password:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

.forgot-password:hover:after {
    width: 80%;
}

.form-footer p {
    color: var(--light-text);
    font-size: 0.95rem;
    margin-top: 10px;
}

.register-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.register-link:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

/* Logo estilizado e animado */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    transition: var(--transition);
}
  
.logo-img {
    height: 140px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.1));
    transition: var(--transition);
    animation: float 6s ease-in-out infinite;
}

.logo-img:nth-child(1) {
    animation-delay: 0s;
}

.logo-img:nth-child(3) {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
  
.logo-separator {
    height: 90px;
    width: 3px;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
    transition: var(--transition);
    animation: pulse-separator 3s infinite;
}

@keyframes pulse-separator {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Estilos para os toasts aprimorados */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    min-width: 300px;
    max-width: 380px;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.15), 0 8px 10px -5px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    animation: slideIn 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    overflow: hidden;
    height: auto;
}

.toast-success {
    background-color: var(--success-color);
    color: white;
    border-left: 5px solid #058c5e;
}

.toast-error {
    background-color: var(--error-color);
    color: white;
    border-left: 5px solid #c91d1d;
}

.toast-icon {
    margin-right: 14px;
    font-size: 22px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 17px;
}

.toast-message {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 8px;
    opacity: 0.7;
    transition: var(--transition);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Animações aprimoradas */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Responsividade com fixação para mobile */
@media (max-width: 640px) {
    html, body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .container {
        width: 100%;
        height: 100%;
        padding: 20px;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .logo-container {
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }

    .logo-img {
        height: 60px; /* Aumentado de 60px */
        width: auto;
    }

    .logo-separator {
        height: 40px;
        margin: 0 15px;
    }

    .login-card {
        width: 100%;
        max-height: none;
        margin: 0;
        padding: 20px;
        border-radius: 15px;
        overflow-y: visible;
    }

    .brand {
        margin-bottom: 20px;
    }

    .logo {
        width: 50px; /* Aumentado de 90px */
        height: 50px; /* Aumentado de 90px */
        margin-bottom: 15px;
    }

    .logo i {
        font-size: 36px; /* Aumentado de 42px */
    }

    h2 {
        font-size: 1.25rem;
        margin-bottom: 24px;
    }

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

    input {
        padding: 14px 14px 14px 45px;
        font-size: 16px;
        height: 50px;
    }

    .input-icon {
        left: 14px;
        font-size: 18px;
    }

    .password-toggle {
        right: 14px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 16px;
        height: 50px;
    }

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

    .toast {
        width: auto;
        min-width: unset;
        max-width: none;
        margin: 0 0 10px 0;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .container {
        padding: 15px;
    }

    .logo-container {
        margin-bottom: 1rem;
    }

    .logo-img {
        height: 70px; /* Aumentado de 50px */
    }

    .logo {
        width: 50px; /* Aumentado de 80px */
        height: 50px; /* Aumentado de 80px */
    }

    .logo i {
        font-size: 48px; /* Aumentado de 38px */
    }

    .login-card {
        padding: 15px;
    }

    .input-group {
        margin-bottom: 15px;
    }
}

/* Fix for iPhone notch and safe areas */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Classe para mensagens */
.message {
    padding: 14px;
    margin-top: 14px;
    border-radius: 10px;
    font-size: 16px;
    display: none;
    animation: fadeIn 0.4s ease;
    border-left: 4px solid;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #10b981;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #ef4444;
}

/* Estilo para as partículas de fundo */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Animação adicional para o logo */
@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
    }
}

.logo-img {
    animation: float 6s ease-in-out infinite, pulse-glow 4s ease-in-out infinite;
}

/* Animação para entrada de elementos */
.login-card {
    animation: fadeInUp 0.8s ease;
}

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

/* Dark Mode Styles */
body.dark {
    background: #18181b !important;
    color: #e5e7eb !important;
}

body.dark .login-card,
body.dark .register-card {
    background-color: #23232a !important;
    border-color: #333 !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.7) !important;
}

body.dark input,
body.dark select {
    background-color: #18181b !important;
    border-color: #333 !important;
    color: #e5e7eb !important;
}

body.dark input::placeholder {
    color: #a1a1aa !important;
}

body.dark input:focus,
body.dark select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
}

body.dark .input-icon {
    color: #6366f1 !important;
}

body.dark .password-toggle {
    color: #a1a1aa !important;
    background-color: rgba(24, 24, 27, 0.5) !important;
}

body.dark .password-toggle:hover {
    color: #6366f1 !important;
    background-color: rgba(99, 102, 241, 0.1) !important;
}

body.dark .btn-primary {
    background-color: #6366f1 !important;
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3) !important;
}

body.dark .btn-primary:before {
    background-color: #4f46e5 !important;
}

body.dark .btn-secondary {
    background-color: #23232a !important;
    color: #e5e7eb !important;
    border-color: #333 !important;
}

body.dark .btn-secondary:hover {
    background-color: #18181b !important;
    border-color: #6366f1 !important;
}

body.dark .forgot-password {
    color: #6366f1 !important;
}

body.dark .forgot-password:hover {
    background-color: rgba(99, 102, 241, 0.1) !important;
}

body.dark .forgot-password:after {
    background-color: #6366f1 !important;
}

body.dark .form-footer p,
body.dark h2 {
    color: #a1a1aa !important;
}

body.dark .register-link {
    color: #6366f1 !important;
}

body.dark .message.success {
    background-color: #023a2f !important;
    color: #10b981 !important;
    border-color: #10b981 !important;
}

body.dark .message.error {
    background-color: #3f1d1d !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

body.dark .toast-success {
    background-color: #023a2f !important;
    border-color: #10b981 !important;
}

body.dark .toast-error {
    background-color: #3f1d1d !important;
    border-color: #ef4444 !important;
}

body.dark .logo-separator {
    background: linear-gradient(to bottom, transparent, #6366f1, transparent) !important;
}

body.dark .logo {
    background-color: #6366f1 !important;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3) !important;
}

/* Dark mode animations */
@keyframes pulse-glow-dark {
    0% {
        filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.3));
    }
}

body.dark .logo-img {
    animation: float 6s ease-in-out infinite, pulse-glow-dark 4s ease-in-out infinite !important;
}

