/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: 'SeccaSoftW03-UltraBlack', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

body:not(.login-page) {
    overflow: auto !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
}

/* Garantir que HTML também não permita rolagem durante login */
html:has(body.login-page) {
    overflow: hidden !important;
    height: 100%;
}

/* Fallback para navegadores que não suportam :has() */
html {
    overflow-x: hidden;
}

html.login-page-active {
    overflow: hidden !important;
    height: 100%;
}

/* Background */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../../public/login_assets/background_login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1000;
}

/* Container */
.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px; /* Aumentado de 400px para 450px */
    max-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 450px; /* Aumentado de 400px para 450px */
    max-height: calc(100vh - 40px);
    text-align: center;
    overflow: hidden;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 60px; /* Aumentado de 40px para 60px */
    position: relative;
    z-index: 3;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.moai-logo {
    height: 160px;
    width: auto;
    filter:
        drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3))
        drop-shadow(0 0 20px rgba(255, 215, 0, 0.2));
    transition: all 0.3s ease;
}

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

.moai-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
    z-index: 3;
    margin-top: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-label {
    font-family: 'SeccaSoftW03-UltraBlack', cursive;
    color: #FFD700;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    -webkit-text-stroke: 1px #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.input-asset {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
}

/* Label estilo protótipo - desabilitado */
.form-group::before {
    display: none;
}

.form-group[data-label="CPF"]::before {
    display: none;
}

.form-group[data-label="Senha"]::before {
    display: none;
}

.form-input {
    position: relative;
    width: 100%;
    padding: 18px 24px;
    background: transparent;
    border: none;
    border-radius: 25px;
    color: #8B4513;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: none;
    height: 60px;
    z-index: 2;
    outline: none;
}

.form-input::placeholder {
    color: rgba(139, 69, 19, 0.7);
    font-weight: 500;
    text-align: center;
}

.form-input:focus {
    outline: none;
    color: #8B4513;
}

.form-input:hover {
    color: #8B4513;
}

/* Button Styles */
.button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    width: 100%;
    max-width: 350px;
}

.button-asset {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 300px;
    height: 70px;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
}

.login-button {
    position: relative;
    width: 100%;
    max-width: 300px;
    padding: 20px 24px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: #8B4513;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: none;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    outline: none;
}

.login-button .button-text {
    color: #8B4513;
    opacity: 1;
    font-weight: 700;
}

.login-button .spinner-border-sm {
    border-color: #8B4513 transparent #8B4513 transparent;
}

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

.login-button:hover .button-asset {
    filter: brightness(1.1);
}

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

.login-button:active {
    transform: scale(0.98);
}

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

.login-button:disabled .button-asset {
    filter: brightness(0.8);
}

.login-button .button-loader.active {
    opacity: 1;
    animation: spin 1s linear infinite;
}

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

/* Mensagem de status durante login */
.login-status {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: fadeInStatus 0.5s ease-out;
}

.status-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.status-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Spinner personalizado */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
    border-style: solid;
    border-color: currentColor transparent currentColor transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.me-2 {
    margin-right: 0.5rem;
}

/* Form Footer */
.form-footer {
    margin-top: 25px;
    position: relative;
    z-index: 3;
}

.links-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.links-container.bottom-links {
    margin-bottom: 0;
    gap: 15px;
}

.footer-link {
    font-family: 'SeccaSoftW03-UltraBlack', cursive;
    color: #FFD700;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 16px;
    border-radius: 15px;
    -webkit-text-stroke: 0.5px #000;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.footer-link:hover {
    color: #FFED4E;
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.register-link {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 15px;
    color: #FFD700 !important;
    font-weight: 700;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.register-link:hover {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
        max-width: 400px; /* Ajustado para mobile */
    }

    .login-container {
        max-width: 100%;
    }

    .logo-section {
        margin-bottom: 50px; /* Ajustado para mobile */
    }

    .moai-logo {
        height: 180px; /* Aumentado de 130px para 180px */
    }

    .moai-title {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .form-label {
        font-size: 16px;
        padding-left: 6px;
    }

    .input-asset {
        height: 55px;
    }

    .form-input {
        padding: 16px 20px;
        font-size: 16px;
        height: 55px;
    }

    .button-asset {
        height: 65px;
        max-width: 280px;
    }

    .login-button {
        padding: 16px 20px;
        font-size: 18px;
        letter-spacing: 1px;
        height: 65px;
        max-width: 280px;
    }

    .button-wrapper {
        max-width: 320px;
    }

    .links-container.bottom-links {
        gap: 12px;
        flex-direction: column;
    }

    .footer-link {
        font-size: 15px;
    }

    .form-group::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 16px;
        max-width: 350px; /* Ajustado para telas pequenas */
    }

    .logo-section {
        margin-bottom: 40px; /* Ajustado para telas pequenas */
    }

    .moai-logo {
        height: 160px; /* Aumentado de 110px para 160px */
    }

    .moai-title {
        font-size: 30px;
        letter-spacing: 1px;
    }

    .form-label {
        font-size: 15px;
        padding-left: 4px;
    }

    .input-asset {
        height: 50px;
    }

    .form-input {
        padding: 15px 18px;
        font-size: 16px;
        height: 50px;
    }

    .button-asset {
        height: 60px;
        max-width: 250px;
    }

    .login-button {
        padding: 15px 18px;
        font-size: 16px;
        height: 60px;
        max-width: 250px;
    }

    .button-wrapper {
        max-width: 280px;
    }

    .links-container.bottom-links {
        gap: 10px;
    }

    .footer-link {
        font-size: 14px;
    }

    .form-group::before {
        display: none;
    }
}

@media (max-height: 700px) {
    .logo-section {
        margin-bottom: 30px; /* Reduzido para telas baixas */
    }

    .moai-logo {
        height: 140px; /* Aumentado de 110px para 140px */
    }

    .moai-title {
        font-size: 32px;
        margin-bottom: 5px;
    }

    .login-form {
        gap: 20px;
        margin-top: 20px;
    }

    .form-footer {
        margin-top: 25px;
    }
}

@media (max-height: 600px) {
    .logo-section {
        margin-bottom: 20px; /* Mais reduzido para telas muito baixas */
    }

    .moai-logo {
        height: 120px; /* Aumentado para manter proporção */
    }

    .moai-title {
        font-size: 28px;
        margin-bottom: 5px;
    }

    .login-form {
        gap: 20px;
        margin-top: 15px;
    }

    .form-footer {
        margin-top: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .login-button::before,
    .moai-logo,
    .login-button,
    .form-input {
        animation: none;
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 4px;
        background: rgba(255, 255, 255, 1);
    }

    .form-input:focus {
        border-width: 5px;
    }

    .login-button {
        border: 3px solid #2C3E50;
    }
}

/* Focus visible for keyboard navigation */
.login-button:focus-visible,
.form-input:focus-visible,
.footer-link:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
}
