/**
 * Login Modal Styles
 * Baseado no design do Figma: https://www.figma.com/design/iH74VsnvP4rB9HZOJttTrh/Spacevents?node-id=248-2
 * Especificações dos campos: padding horizontal 24px, vertical 18px, altura 56px
 */

/* Backdrop */
.login-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-modal-backdrop.active {
    opacity: 1;
}

/* Modal */
.login-modal {
    position: relative;
    width: 100%;
    max-width: 560px !important;
    background: #FFFFFF;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

/* Garante que todos os elementos dentro do modal usem Poppins */
.login-modal * {
    font-family: 'Poppins', sans-serif !important;
}

.login-modal-backdrop.active .login-modal {
    transform: scale(1);
}

/* Close Button */
.login-modal-close {
    position: absolute;
    top: 12px;
    left: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    transition: color 0.2s ease;
    z-index: 1;
    width: 40px;
    height: 40px;
}

.login-modal-close:hover {
    color: #666666;
}

.login-modal-close svg {
    width: 100%;
    height: 100%;
}

/* Header */
.login-modal-header {
    padding: 32px 40px 24px;
    text-align: center;
    border-bottom: 1px solid #E0E0E0;
    margin-bottom: 0;
}

.login-modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #000000;
    margin: 0;
}

/* Body */
.login-modal-body {
    padding: 24px 40px 40px;
}

.login-modal-welcome {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #000000;
    margin: 0 0 32px 0;
    text-align: center;
}

/* Form */
.login-form {
    margin-bottom: 20px;
}

/* Container do grupo de inputs */
.form-inputs-group {
    margin-bottom: 8px !important;
}

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

/* Input Fields - Especificações: 400px width, 56px height, padding 24px horizontal, 18px vertical */
.form-control {
    width: 100%;
    height: 56px;
    padding: 18px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 100%;
    color: #000000;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 16px !important; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Grupo de inputs Email e Senha - colados sem espaço */
.form-inputs-group .form-group:first-of-type {
    margin-bottom: 0;
}

.form-inputs-group .form-group:first-of-type .form-control,
.form-inputs-group .form-group:first-of-type input.form-control,
#loginEmail.form-control,
.form-inputs-group .form-group:first-of-type #loginEmail {
    border-radius: 16px 16px 0 0 !important;
    border-bottom: none;
}

.form-inputs-group .form-group:nth-of-type(2) {
    margin-bottom: 0;
}

.form-inputs-group .form-group:nth-of-type(2) .form-control,
.form-inputs-group .form-group:nth-of-type(2) input.form-control,
#loginSenha.form-control,
.form-inputs-group .form-group:nth-of-type(2) #loginSenha {
    border-radius: 0 0 16px 16px !important;
    border-top: 1px solid #E0E0E0;
    border-bottom: 1px solid #E0E0E0;
    border-left: 1px solid #E0E0E0;
    border-right: 1px solid #E0E0E0;
}

/* Garante que o border-radius e bordas sejam aplicados mesmo com password-input-wrapper */
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control,
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper input.form-control,
.password-input-wrapper #loginSenha.form-control,
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper #loginSenha {
    border-radius: 0 0 16px 16px !important;
    border-top: 1px solid #E0E0E0 !important;
    border-bottom: 1px solid #E0E0E0 !important;
    border-left: 1px solid #E0E0E0 !important;
    border-right: 1px solid #E0E0E0 !important;
}

/* Focus - mantém borda contínua */
.form-inputs-group .form-group:first-of-type .form-control:focus,
.form-inputs-group .form-group:first-of-type input.form-control:focus,
#loginEmail.form-control:focus,
.form-inputs-group .form-group:first-of-type #loginEmail:focus {
    border-bottom: 1px solid #FF7854 !important;
    border-radius: 16px 16px 0 0 !important;
    z-index: 1;
    position: relative;
}

.form-inputs-group .form-group:nth-of-type(2) .form-control:focus,
.form-inputs-group .form-group:nth-of-type(2) input.form-control:focus,
#loginSenha.form-control:focus,
.form-inputs-group .form-group:nth-of-type(2) #loginSenha:focus {
    border-color: #FF7854 !important;
    border-top: 1px solid #FF7854 !important;
    border-bottom: 1px solid #FF7854 !important;
    border-left: 1px solid #FF7854 !important;
    border-right: 1px solid #FF7854 !important;
    border-radius: 0 0 16px 16px !important;
    z-index: 1;
    position: relative;
}

/* Garante que a borda inferior seja visível no foco mesmo com password-input-wrapper */
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control:focus,
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper input.form-control:focus,
.password-input-wrapper #loginSenha.form-control:focus,
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper #loginSenha:focus {
    border-color: #FF7854 !important;
    border-top: 1px solid #FF7854 !important;
    border-bottom: 1px solid #FF7854 !important;
    border-left: 1px solid #FF7854 !important;
    border-right: 1px solid #FF7854 !important;
    border-radius: 0 0 16px 16px !important;
}

/* Hover - mantém borda contínua */
.form-inputs-group .form-group:first-of-type .form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:first-of-type input.form-control:hover:not(:disabled):not(:focus),
#loginEmail.form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:first-of-type #loginEmail:hover:not(:disabled):not(:focus) {
    border-bottom: 1px solid #FF7854 !important;
    border-radius: 16px 16px 0 0 !important;
}

.form-inputs-group .form-group:nth-of-type(2) .form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:nth-of-type(2) input.form-control:hover:not(:disabled):not(:focus),
#loginSenha.form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:nth-of-type(2) #loginSenha:hover:not(:disabled):not(:focus) {
    transition: none !important;
    border-color: #FF7854 !important;
    border-top: 1px solid #FF7854 !important;
    border-bottom: 1px solid #FF7854 !important;
    border-left: 1px solid #FF7854 !important;
    border-right: 1px solid #FF7854 !important;
    border-radius: 0 0 16px 16px !important;
}

/* Garante que todas as bordas fiquem laranjas no hover mesmo com password-input-wrapper */
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper input.form-control:hover:not(:disabled):not(:focus),
.password-input-wrapper #loginSenha.form-control:hover:not(:disabled):not(:focus),
.form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper #loginSenha:hover:not(:disabled):not(:focus) {
    transition: none !important;
    border-color: #FF7854 !important;
    border-top: 1px solid #FF7854 !important;
    border-bottom: 1px solid #FF7854 !important;
    border-left: 1px solid #FF7854 !important;
    border-right: 1px solid #FF7854 !important;
    border-radius: 0 0 16px 16px !important;
}

.form-control:focus {
    outline: none;
    border-color: #FF7854;
    box-shadow: 0 0 0 3px rgba(255, 120, 84, 0.1);
}

/* Regra geral de hover - não afeta inputs agrupados */
.form-control:hover:not(:disabled):not(:focus) {
    border-color: #FF7854;
}

/* Sobrescreve regra geral para inputs agrupados - evita delay/preto */
.form-inputs-group .form-control:hover:not(:disabled):not(:focus) {
    transition: none;
}

.form-control::placeholder {
    color: #999999;
}

.form-control:disabled {
    background: #F5F5F5;
    border-color: #E0E0E0;
    color: #999999;
    cursor: not-allowed;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    transition: color 0.2s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: #000000;
}

.password-input-wrapper .form-control {
    padding-right: 56px; /* 24px (padding) + 20px (icon) + 12px (spacing) */
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.eye-off-icon {
    display: none !important;
}

.password-toggle.active .eye-icon {
    display: none !important;
}

.password-toggle.active .eye-off-icon {
    display: block !important;
}

/* Form Errors Container */
.form-errors-container {
    margin-top: 8px;
    min-height: 20px;
}

.form-errors-container .form-error {
    display: block;
    margin-bottom: 4px;
}

/* Form Errors */
.form-error {
    display: none;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #FF3B30;
    padding-left: 4px;
}

/* Primary Button */
.btn-login-primary {
    width: 100%;
    height: 56px;
    padding: 0 24px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    color: #FFFFFF;
    background: #FF7854;
    border: none;
    border-radius: 16px !important;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-login-primary:hover:not(:disabled) {
    background: #E66A4A;
}

.btn-login-primary:active:not(:disabled),
.btn-login-primary:focus:not(:disabled) {
    background: #E66A4A !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 120, 84, 0.2);
    transform: scale(0.98);
}

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

.btn-loader {
    display: none;
}

.btn-loader .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Login Links */
.login-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.link-forgot,
.link-register {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-style: normal;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    transition: color 0.2s ease;
}

.link-forgot {
    font-size: 14px;
    color: #FF7854 !important;
    text-decoration: underline !important;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: #FF7854;
}

.link-register {
    font-size: 16px;
}

.link-forgot:hover {
    color: #E66A4A !important;
}

.link-register {
    color: #000000 !important;
    text-decoration: none !important;
}

.link-register:hover {
    color: #000000 !important;
}

.link-register strong {
    font-weight: 600;
    color: #FF7854 !important;
    text-decoration: underline !important;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: #FF7854;
}

.link-register:hover strong {
    color: #E66A4A !important;
    text-decoration-color: #E66A4A;
}

.link-separator {
    color: #FF7854;
}

/* Separator */
.login-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: #E0E0E0;
}

.separator-text {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #666666;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: left;
    color: #000000;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 16px !important;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-social:hover {
    border-color: #FF7854;
    background: #FFF5F3;
}

.btn-social:active,
.btn-social:focus {
    border-color: #FF7854 !important;
    background: #FFF5F3 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 120, 84, 0.1);
}

.btn-social:active {
    transform: scale(0.98);
}

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

/* Apple Icon - Um pouco maior */
.btn-apple .social-icon {
    width: 26px;
    height: 26px;
}

/* Google Icon Colors */
.btn-google .social-icon path:nth-child(1) { fill: #4285F4; }
.btn-google .social-icon path:nth-child(2) { fill: #34A853; }
.btn-google .social-icon path:nth-child(3) { fill: #FBBC05; }
.btn-google .social-icon path:nth-child(4) { fill: #EA4335; }

/* Facebook Icon Color */
.btn-facebook .social-icon {
    color: #1877F2;
}

/* Responsive */

/* Telas médias (14/15 polegadas - 1366px a 1600px) */
@media (min-width: 1366px) and (max-width: 1600px) {
    .login-modal {
        max-width: 540px !important;
        max-height: 98vh;
        overflow-y: auto;
    }

    .login-modal-close {
        top: 10px;
    }

    .login-modal-header {
        padding: 24px 32px 8px;
    }

    .login-modal-body {
        padding: 16px 32px 24px;
    }

    .login-modal-welcome {
        font-size: 26px;
        margin-bottom: 16px;
        margin-top: 8px;
    }

    .form-control {
        height: 48px;
        padding: 14px 18px;
    }

    .form-inputs-group {
        margin-bottom: 10px;
    }

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

    .form-errors-container {
        margin-top: 4px;
        min-height: 16px;
    }

    .form-error {
        font-size: 11px;
    }

    .btn-login-primary {
        margin-bottom: 8px;
        height: 48px;
        font-size: 15px;
    }

    .login-links {
        margin-bottom: 10px;
        gap: 16px;
    }

    .login-separator {
        margin: 10px 0;
    }

    .separator-text {
        font-size: 13px;
    }

    .social-login {
        gap: 8px;
    }

    .btn-social {
        height: 48px;
        font-size: 15px;
        padding: 0 14px;
    }

    .login-form {
        margin-bottom: 12px;
    }

    .social-icon {
        width: 18px;
        height: 18px;
    }

    .btn-apple .social-icon {
        width: 22px;
        height: 22px;
    }
}

/* Tablets grandes e telas médias (1024px - 1365px) */
@media (max-width: 1024px) {
    .login-modal {
        max-width: 90%;
        max-height: 92vh;
    }

    .login-modal-header {
        padding: 36px 32px 0;
    }

    .login-modal-body {
        padding: 24px 32px 36px;
    }
}

/* Tablets (768px - 600px) */
@media (max-width: 768px) {
    .login-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .login-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0 !important;
        max-height: 90vh;
    }

    .login-modal-header {
        padding: 32px 24px 0;
    }

    .login-modal-body {
        padding: 24px 24px 32px;
    }

    .login-modal-welcome {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .login-modal-close {
        top: 16px;
        left: 16px;
        width: 36px;
        height: 36px;
    }

    .form-control {
        height: 52px;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 12px !important;
    }

    .form-inputs-group .form-group:first-of-type .form-control {
        border-radius: 12px 12px 0 0 !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .form-control {
        border-radius: 0 0 12px 12px !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control {
        border-radius: 0 0 12px 12px !important;
    }

    .btn-login-primary {
        height: 52px;
        font-size: 16px;
        border-radius: 12px !important;
    }

    .btn-social {
        height: 52px;
        font-size: 16px;
        border-radius: 12px !important;
    }

    .login-links {
        gap: 20px;
    }
}

/* Smartphones grandes (600px - 480px) */
@media (max-width: 600px) {
    .login-modal-header {
        padding: 28px 20px 0;
    }

    .login-modal-body {
        padding: 20px 20px 28px;
    }

    .login-modal-welcome {
        font-size: 26px;
        margin-bottom: 20px;
    }

    .form-control {
        height: 50px;
        padding: 15px 18px;
    }

    .btn-login-primary {
        height: 50px;
    }

    .btn-social {
        height: 50px;
    }
}

/* Smartphones (480px - 360px) */
@media (max-width: 480px) {
    .login-modal-header {
        padding: 24px 16px 0;
    }

    .login-modal-body {
        padding: 20px 16px 24px;
    }

    .login-modal-welcome {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .login-modal-close {
        top: 12px;
        left: 12px;
        width: 32px;
        height: 32px;
    }

    .form-control {
        font-size: 16px; /* Evita zoom no iOS */
        height: 48px;
        padding: 14px 16px;
        border-radius: 10px !important;
    }

    .form-inputs-group .form-group:first-of-type .form-control {
        border-radius: 10px 10px 0 0 !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .form-control {
        border-radius: 0 0 10px 10px !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control {
        border-radius: 0 0 10px 10px !important;
    }

    .btn-login-primary {
        height: 48px;
        font-size: 16px;
        border-radius: 10px !important;
    }

    .btn-social {
        height: 48px;
        font-size: 14px;
        padding: 0 12px;
        border-radius: 10px !important;
    }

    .login-links {
        flex-direction: column;
        gap: 12px;
        font-size: 14px;
    }

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

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

    .social-icon {
        width: 18px;
        height: 18px;
    }

    .btn-apple .social-icon {
        width: 22px;
        height: 22px;
    }
}

/* Smartphones pequenos (360px e abaixo) */
@media (max-width: 360px) {
    .login-modal-header {
        padding: 20px 12px 0;
    }

    .login-modal-body {
        padding: 16px 12px 20px;
    }

    .login-modal-welcome {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .login-modal-title {
        font-size: 14px;
    }

    .form-control {
        height: 44px;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 8px !important;
    }

    .form-inputs-group .form-group:first-of-type .form-control {
        border-radius: 8px 8px 0 0 !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .form-control {
        border-radius: 0 0 8px 8px !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control {
        border-radius: 0 0 8px 8px !important;
    }

    .btn-login-primary {
        height: 44px;
        font-size: 14px;
        border-radius: 8px !important;
    }

    .btn-social {
        height: 44px;
        font-size: 13px;
        padding: 0 10px;
        gap: 10px;
        border-radius: 8px !important;
    }

    .login-links {
        gap: 10px;
        font-size: 12px;
    }

    .link-forgot {
        font-size: 12px;
    }

    .link-register {
        font-size: 12px;
    }

    .separator-text {
        font-size: 12px;
    }
}

/* Telas muito pequenas (320px e abaixo) */
@media (max-width: 320px) {
    .login-modal-welcome {
        font-size: 20px;
    }

    .form-control {
        height: 42px;
        padding: 11px 12px;
    }

    .btn-login-primary {
        height: 42px;
        font-size: 13px;
    }

    .btn-social {
        height: 42px;
        font-size: 12px;
    }
}

/* Altura pequena (landscape em mobile) */
@media (max-height: 600px) and (max-width: 768px) {
    .login-modal {
        max-height: 95vh;
    }

    .login-modal-header {
        padding: 20px 24px 0;
    }

    .login-modal-body {
        padding: 16px 24px 20px;
    }

    .login-modal-welcome {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .form-control {
        height: 48px;
        padding: 14px 18px;
        border-radius: 10px !important;
    }

    .form-inputs-group .form-group:first-of-type .form-control {
        border-radius: 10px 10px 0 0 !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .form-control {
        border-radius: 0 0 10px 10px !important;
    }

    .form-inputs-group .form-group:nth-of-type(2) .password-input-wrapper .form-control {
        border-radius: 0 0 10px 10px !important;
    }

    .btn-login-primary {
        height: 48px;
        border-radius: 10px !important;
    }

    .btn-social {
        height: 48px;
        border-radius: 10px !important;
    }

    .login-links {
        margin-bottom: 12px;
    }

    .login-separator {
        margin: 16px 0;
    }
}

