body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    background-color: #F0F0F0;
}

.header {
    width: 100%;
    background-color: #FFFFFF;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    height: 80px;
    position: relative;
    flex-shrink: 0; 
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
    position: relative;
    height: 100%;
}

.line2 {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #39693C;
    font-size: 14px;
    font-weight: bold;
}

.install-help-button {
    position: absolute;
    right: 140px;
    top: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #cad5cb;
    background: #ffffff;
    color: #39693C;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.install-help-button:hover {
    background: #eef5ef;
    border-color: #39693C;
}

.install-help-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.logo {
    max-height: 60px;
    max-width: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.map-container {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

#map {
    height: 100%;
    width: 100%;
}

.button-container {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-button {
    padding: 10px 20px;
    background-color: #39693C;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.5s ease;
    margin: 0;
}

.custom-button:hover {
    background-color: #2a4e2c;
}

.custom-button.hidden {
    display: none;
}

#install-button-container {
    position: absolute;
    top: 10px;
    left: 20px; /* Keep it on the left side */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#loadGeojson, #navButton, #installAppButton {
    position: relative;
}

#legend {
    position: absolute;
    bottom: 20px;
    left: 10px;
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #D5E8D0;
    max-width: 250px;
    transition: all 0.3s ease; 
}

.auto-center-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: white;
    color: #39693C;
    border: 1px solid #D5E8D0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.auto-center-button:hover {
    background-color: #D5E8D0;
}

.auto-center-button.active {
    background-color: #39693C;
    color: white;
}

.position-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 1px solid #D5E8D0;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
}

.position-indicator.has-value {
    color: #39693C;
    font-weight: bold;
}

.exit-confirmation-modal, .edit-value-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.exit-confirmation-modal .modal-content, .edit-value-modal .modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 340px;
    max-width: 90%;
    text-align: center;
}

.exit-confirmation-modal h3, .edit-value-modal h3 {
    color: #39693C;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.exit-confirmation-modal p {
    margin-bottom: 20px;
    color: #666;
}

.exit-confirmation-modal .modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin: 10px auto 0;
}

.exit-confirmation-modal .modal-buttons .custom-button {
    width: 100%;
    padding: 12px;
    margin: 0;
    font-size: 14px;
}

.exit-confirmation-modal .save-button { background-color: #39693C; }
.exit-confirmation-modal .exit-button { background-color: #dc3545; }
.exit-confirmation-modal .cancel-button { background-color: #6c757d; }

.legend-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.legend-header b { margin-bottom: 0; line-height: 1.2; }

.legend-collapse-button {
    cursor: pointer;
    font-size: 25px;
    border: none;
    background: none;
    padding: 0;
    margin-left: 30px;
    color: #39693C;
}
.legend-collapse-button:hover { color: #2a4e2c; }

.legend-items-container {
    padding-bottom: 3px;
}

.legend-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 3px;
}

#legend-edit-btn {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #39693C;
    border: none;
    background: none;
    padding: 0;
}
#legend-edit-btn:hover { color: #2a4e2c; }

.legend-item { display: flex; align-items: center; margin-bottom: 4px; }
.legend-item i { width: 15px; height: 15px; display: inline-block; margin-right: 5px; flex-shrink: 0; }
.legend-item-edit-icon { cursor: pointer; font-size: 18px; line-height: 1; color: #6c757d; margin-left: 8px; display: none; }
.legend-item-edit-icon:hover { color: #343a40; }
#legend.editing .legend-item-edit-icon { display: inline-block; }
.edit-value-modal input { width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 16px; }
.edit-value-modal .modal-buttons { display: flex; justify-content: space-around; gap: 10px; }

#legend.collapsed {
    width: auto;
    height: auto;
    padding: 7px;
}
#legend.collapsed .legend-header {
    margin-bottom: 0;
}
#legend.collapsed .legend-header b,
#legend.collapsed .legend-items-container,
#legend.collapsed .legend-footer {
    display: none;
}

#legend.collapsed .legend-collapse-button {
    font-size: 33px;
    line-height: 1;
	margin-left: 3px;
}

.format-toggle-container.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.format-toggle-container.disabled .format-label {
    color: #ccc !important;
}

.format-toggle-container.offline .label-shp {
    text-decoration: line-through;
}

@media (max-width: 600px) {
    .header {
        height: 60px;
        padding: 5px 10px;
    }

    .logo {
        max-height: 50px;
        max-width: 120px;
        width: auto;
        height: auto;
    }

    .line2 {
        top: 10px;
        right: 10px;
    }

    .install-help-button {
        top: 12px;
        right: 100px;
        width: 30px;
        height: 30px;
    }

    .button-container {
        top: 60px; 
        right: 10px; 
    }
				
    #install-button-container {
        top: 60px;
        left: 10px;
    }				
				
    .button-container .custom-button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .position-indicator {
        font-size: 14px;
        min-width: 140px;
        padding: 8px 15px;
    }

    #legend, .auto-center-button {
        bottom: 10px;
    }
    
    #legend {
        left: 10px;
    }
    
    .auto-center-button {
        right: 10px;
    }

}


.install-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.install-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.install-modal-content {
    background-color: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 420px;
    max-width: 90%;
    text-align: center;
}

.install-modal-content h3 {
    color: #39693C;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
}

.install-modal-content #install-instructions-text {
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    text-align: left;
}

.install-modal-content .install-copy {
    margin: 0 0 12px 0;
}

.install-modal-content .install-steps {
    margin: 0;
    padding-left: 20px;
}

.install-modal-content .install-steps li {
    margin-bottom: 10px;
}

.install-modal-content .install-inline-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin: 0 3px;
}

.install-modal-content .install-inline-icon svg {
    width: 16px;
    height: 16px;
    stroke: #1f2937;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.install-modal-content .close-modal-btn {
    margin-top: 15px;
    background-color: #6c757d;
}

.custom-button:disabled {
    background-color: #aeb8af; /* Uma cor mais neutra/cinza */
    opacity: 0.6; /* Reduz a opacidade */
    cursor: not-allowed; /* Indicates non-clickable state */
}

.custom-button:disabled:hover {
    background-color: #aeb8af; /* Keeps color stable on hover */
}

#app-version-display {
    position: relative;
    top: 12px;           
    left: 20px;         
}

/* ===== ESTILOS DE LOGIN ===== */

.login-modal {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 14% 10%, rgba(57, 105, 60, 0.24), transparent 38%),
        radial-gradient(circle at 90% 90%, rgba(66, 133, 244, 0.2), transparent 40%),
        rgba(11, 16, 14, 0.84);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 28px 14px;
}

.login-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-modal-content {
    position: relative;
    background: #ffffff;
    padding: 20px 22px 18px;
    border-radius: 22px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(57, 105, 60, 0.14);
    width: min(400px, 86vw);
    max-height: 84vh;
    overflow-y: auto;
}

.login-modal-content::before {
    content: none;
}

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

.login-logo {
    width: clamp(110px, 24vw, 150px);
    max-width: 100%;
    height: auto;
    margin: 0 auto 10px;
    display: block;
    filter: none;
}

.login-header h2 {
    color: #254f2a;
    margin: 0 0 4px;
    font-size: clamp(1.1rem, 1.95vw, 1.45rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.login-subtitle {
    color: #2f3f33;
    font-size: 1.68rem;
    margin: 0 0 4px;
    font-weight: 600;
    line-height: 1.22;
}

.login-info {
    color: #667272;
    font-size: 0.93rem;
    margin: 0;
    font-weight: 400;
    font-style: italic;
    line-height: 1.35;
}

#login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.form-group-spaced {
    margin-top: 6px;
}

.form-group label {
    color: #1f2426;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.form-group input {
    height: 48px;
    padding: 10px 12px;
    border: 1px solid #cfd8d1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.24s ease;
    box-sizing: border-box;
    background-color: #fff;
    color: #1e2420;
}

.form-group input:focus {
    outline: none;
    border-color: #39693C;
    box-shadow: 0 0 0 4px rgba(57, 105, 60, 0.12);
}

.form-group input::placeholder {
    color: #98a2a4;
    font-size: 0.96rem;
}

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

.password-input-wrapper input {
    width: 100%;
    padding-right: 54px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: #eef3ef;
    border: 1px solid #d7e0d9;
    cursor: pointer;
    padding: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f6363;
    transition: all 0.2s ease;
    border-radius: 9px;
}

.toggle-password:hover {
    color: #2f5f32;
    border-color: #c3d0c5;
    background-color: #e8efe9;
}

.toggle-password:active {
    transform: scale(0.96);
}

.eye-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.error-message {
    background-color: #fff1f1;
    color: #b02d2d;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.94rem;
    text-align: center;
    border: 1px solid #ffc5c5;
    margin-top: 8px;
    line-height: 1.4;
}

.error-message.hidden {
    display: none;
}

.login-button {
    background-color: #16DA51;
    width: 88%;
    min-height: 48px;
    padding: 9px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 10px auto 0;
    border-radius: 12px;
    letter-spacing: 0.03em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 22px rgba(22, 218, 81, 0.3);
}

.login-button:hover {
    transform: translateY(-1px);
    background-color: #12c649;
    box-shadow: 0 12px 22px rgba(22, 218, 81, 0.36);
}

.login-button .button-loader {
    display: inline-block;
}

.login-button .button-loader.hidden {
    display: none;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 12px 0 10px;
    text-align: center;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #d7ded8;
}

.login-divider span {
    padding: 0 14px;
    color: #738180;
    font-size: 0.84rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.social-login-button {
    margin: 0 auto;
    width: 88%;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f1f1f;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    border: 1px solid #d5dde6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(26, 38, 59, 0.12);
}

.social-login-button:hover {
    border-color: #b5c7de;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(26, 38, 59, 0.16);
}

.social-login-button .social-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #d7dde5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.social-login-button .social-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

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

/* Social Login Instructions Modal */
.instructions-content {
    width: 600px;
    max-width: 95%;
    position: relative;
}

.close-instructions {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close-instructions:hover {
    color: #333;
}

.instructions-header {
    text-align: center;
    margin-bottom: 30px;
    padding-right: 40px;
}

.instructions-header h2 {
    color: #39693C;
    margin: 0 0 10px 0;
    font-size: 22px;
}

.instructions-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.instructions-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.instruction-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background-color: #39693C;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 15px;
}

.step-content p strong {
    color: #39693C;
}

.step-detail {
    color: #666 !important;
    font-size: 13px !important;
    font-style: italic;
}

.step-link {
    display: inline-block;
    color: #4285f4;
    text-decoration: none;
    font-size: 14px;
    margin-top: 5px;
    transition: color 0.3s ease;
}

.step-link:hover {
    color: #357ae8;
    text-decoration: underline;
}

.understood-button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

/* Responsividade para modais de login */
@media (max-width: 600px) {
    .login-modal {
        padding: 18px 10px;
    }

    .login-modal-content {
        width: 100%;
        max-width: 94vw;
        padding: 18px 12px 14px;
        border-radius: 16px;
    }

    .login-logo {
        width: clamp(100px, 36vw, 132px);
        margin-bottom: 14px;
    }

    .login-header {
        margin-bottom: 22px;
    }

    .login-header h2 {
        font-size: clamp(1.35rem, 5.2vw, 1.65rem);
    }

    .login-subtitle {
        font-size: 1.35rem;
        margin-bottom: 8px;
    }

    .login-info {
        font-size: 0.88rem;
    }

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

    .form-group input {
        height: 46px;
        font-size: 0.98rem;
    }

    .form-group input::placeholder {
        font-size: 0.9rem;
    }

    .login-button,
    .social-login-button {
        width: 100%;
        margin: 0;
        min-height: 46px;
    }

    .login-button {
        font-size: 0.92rem;
        margin-top: 10px;
    }

    .social-login-button {
        font-size: 0.92rem;
        gap: 8px;
    }

    .social-login-button .social-icon {
        width: 32px;
        height: 32px;
    }

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

    .instructions-content {
        width: 95%;
        padding: 20px;
    }

    .instructions-header {
        padding-right: 0;
    }

    .close-instructions {
        top: 10px;
        right: 10px;
    }

    .instruction-step {
        gap: 12px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}
